// JScript source code
if (document.images)
{	
  pic1= new Image(10,10); 
  pic1.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomLCornerOpen.gif"; 

  pic2= new Image(10,10); 
  pic2.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomRCornerOpen.gif"; 

  pic3= new Image(1,28); 
  pic3.src="http://www.bipbip.co.il/Images/Ads/Professional/AdTopBG.gif"; 
  
  pic4= new Image(10,28); 
  pic4.src="http://www.bipbip.co.il/Images/Ads/Professional/TopLCornerOpen.gif"; 
  
  pic5= new Image(10,28); 
  pic5.src="http://www.bipbip.co.il/Images/Ads/Professional/TopRCornerOpen.gif"; 
  
  pic6= new Image(18,16); 
  pic6.src="http://www.bipbip.co.il/Images/Ads/Professional/ProPrintIcon.png"; 
  
  pic7= new Image(18,16); 
  pic7.src="http://www.bipbip.co.il/Images/Ads/Professional/ProCloseDetailsIcon.png";
  
  pic8= new Image(10,10); 
  pic8.src="http://www.bipbip.co.il/Images/Ads/Professional/TopLCorner.gif"; 
  
  pic9= new Image(10,10); 
  pic9.src="http://www.bipbip.co.il/Images/Ads/Professional/TopRCorner.gif"; 
  
  pic10= new Image(10,10); 
  pic10.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomLCorner.gif"; 
  
  pic11= new Image(10,10); 
  pic11.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomRCorner.gif";
  
  pic12= new Image(10,10); 
  pic12.src="http://www.bipbip.co.il/Images/Ads/Professional/TopLCorner1.gif"; 
  
  pic13= new Image(10,10); 
  pic13.src="http://www.bipbip.co.il/Images/Ads/Professional/TopRCorner1.gif"; 
  
  pic14= new Image(10,10); 
  pic14.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomLCorner1.gif"; 
  
  pic15= new Image(10,10); 
  pic15.src="http://www.bipbip.co.il/Images/Ads/Professional/BottomRCorner1.gif";
  
  pic16= new Image(116,92); 
  pic16.src="http://www.bipbip.co.il/Images/Ads/Professional/PicBG.gif";
  
  pic17= new Image(116,92); 
  pic17.src="http://www.bipbip.co.il/Images/Ads/Professional/PicBG1.gif"; 
}


//בודק אם הערך הוא מספר או לא ------------------------------
function IsNumeric(sText,Field)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         check = false;
			
			if(Field=="Phone1")
			{
			document.AddForm.alert.value='נא למלא מספרים בלבד במספר טלפון';
			}
			
			if(Field=="Phone2")
			{
			document.AddForm.alert.value='נא למלא מספרים בלבד במספר טלפון';
			}
			
			if(Field=="Fax")
			{
			document.AddForm.alert.value='נא למלא מספרים בלבד במספר פקס';
			}
         }
      }
   
   }




//בדיקת טופס הוספת מודעה  ---------------------------------------------------------------------------------------------------------
function CheckProfessionalForm()

{
var check = true


if (document.AddForm.strCAPTCHA)
{
	if (document.AddForm.strCAPTCHA.value == "") 
	{
	check = false; 
	document.AddForm.alert.value='נא למלא קוד אבטחה';
	}
}

if (document.AddForm.Password.value.length <4 || document.AddForm.Password.value.length >8)
{
check = false; 
document.AddForm.alert.value='נא למלא סיסמה בת 4-8 תווים';
}

if (document.AddForm.Password.value == "") 
{
check = false; 
document.AddForm.alert.value='נא למלא סיסמה';
}

if (document.AddForm.Email.value != "")
{
	var testresults
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			
		if (filter.test(document.AddForm.Email.value))
		{
		
		}
		else
		{
		check = false;
		document.AddForm.alert.value='כתובת האימייל אינה תקינה';
		}
}

if (document.AddForm.ContactEmail.value != "")
{
	var testresults
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			
		if (filter.test(document.AddForm.ContactEmail.value))
		{
		
		}
		else
		{
		check = false;
		document.AddForm.alert.value='כתובת האימייל אינה תקינה';
		}
}

if (document.AddForm.Email.value == "") 
{
check = false; 
document.AddForm.alert.value='נא למלא אימייל';
}

if (document.AddForm.Fax.value != "")
{
	IsNumeric(document.AddForm.Fax.value,'Fax');
}

if (document.AddForm.Phone2.value != "")
{
	IsNumeric(document.AddForm.Phone2.value,'Phone2');
}

IsNumeric(document.AddForm.Phone1.value,'Phone1');

if (document.AddForm.Phone1.value == "" || document.AddForm.AreaCode1.value == "") 
{
check = false; 
document.AddForm.alert.value='נא למלא מספר טלפון וקידומת';
}

if (document.AddForm.ContactName.value == "") 
{
check = false; 
document.AddForm.alert.value='נא למלא לפנות ל';
}


if (document.AddForm.Name.value == "")
{
check = false; 
document.AddForm.alert.value='נא למלא את שם העסק';
}

if (document.AddForm.Areas.value == "")
{
check = false; 
document.AddForm.alert.value='נא לבחור אזור מתן שרות';
}

if (document.AddForm.SubCategorys.value == "")
{
check = false; 
document.AddForm.alert.value='נא לבחור לפחות סיווג אחד';
}

/*if (document.AddForm.Category.value == "")
{
check = false; 
document.AddForm.alert.value='נא לבחור תחום ראשי';
}*/

if (check)
{
	document.AddForm.alert.value='';
	document.getElementById('Submit').style.display = 'none';
	document.getElementById('SubmitMessage').style.display = '';
	return true
}
return false
}


///פונקציות למערכים *********************************************************************************
function Match(ManufID,ModelFormId){
				this.ManufID=ManufID;
				this.ModelForm=ModelFormId;
		}			
		
		function Add_ModelForm(val,txt){
			this.value = val;
			this.text = txt;
		}
		
		function CheckLength()
		{
		
		
		var ObjModelForm = this.ModelFormID;
		
			if(ObjModelForm.options.length<2){
				ObjModelForm.disabled=true;
				ObjModelForm.selectedIndex =-1
				ObjModelForm.options[0].text=""
		
		
				ObjModelForm.style.backgroundColor="#c0c0c0"	
			}else{
				ObjModelForm.style.backgroundColor="white"	
				ObjModelForm.options[0].text="Please select"
				ObjModelForm.selectedIndex = 0
		
				ObjModelForm.disabled=false;
			}
		
		}
		
		function ShowModelForms(form)
		{
			var vcPrimaryManufBox = form.Category ;
			var ObjModelForm = form.SubCategory;
			var i=0,i1=0,i2=0;
			var TmpStr;
			var vcPrimaryManufs = new Array;
				TmpArr = new Array;
				tmp=new Array;
			ObjModelForm.selectedIndex = 0 ;
		
			for(i=ObjModelForm.options.length-1;i>0;i--) 
			{
				ObjModelForm.options[i] = null;
			}
		
			selected_vcPrimaryManuf=(vcPrimaryManufBox.options.selectedIndex!=-1)? vcPrimaryManufBox.options[vcPrimaryManufBox.options.selectedIndex].value : 0;
		
			for (i=0; i < vcPrimaryManufBox.options.length ;i++)
			{
				if (vcPrimaryManufBox.options[i].selected)
				{
					vcPrimaryManufs[i1]=vcPrimaryManufBox.options[i].value;
					i1++;
				}
			}
			
			
			i=0;
			var j=1;
			for (i2=0;i2<vcPrimaryManufs.length;i2++)
			{					
				while (ModelFormByManuf[i].ManufID != vcPrimaryManufs[i2])
					if (i < ModelFormByManuf.length-1) i++;
					else {return;}	
				i1=0;
				while (ModelFormByManuf[i].ManufID ==  vcPrimaryManufs[i2] && i1<ModelForm.length)
				{						
					if (ModelForm[i1].value == ModelFormByManuf[i].ModelForm)
					{
						TmpStr = TmpArr.join(' ,');
						if ((TmpStr.indexOf(' ,'+ModelForm[i1].value)==-1) && (TmpStr.indexOf(ModelForm[i1].value+' ,')==-1))
						{
							TmpArr[j-1] = ModelForm[i1].value;
							ObjModelForm.options[j] = new Option(ModelForm[i1].text,ModelForm[i1].value);
							j++;
						}
						i++;
					}
						
		
					if(i<ModelForm.length)
						i1++;
					else 
						{
						return;
						}
				}
			}
		
		
		}
		
		
	function AddSubCategorys()
	{
		var MyForm = document.forms["AddForm"];
		// ----------------------------------------------------------------- //
		// ***************************************************************** //
		// MyForm.SubCategorys.value - Send this value to the insert page //
		// ***************************************************************** //
		// ----------------------------------------------------------------- //
		
		var SubCategory = MyForm.SubCategory.options[MyForm.SubCategory.selectedIndex].value;
		if (SubCategory!="")
		{
			var temp = new Array();
			temp = SubCategory.split('@');
			
			
			// SubCategorys IDs *****************************************************
			if (MyForm.SubCategorys.value!="")
			{
				// Check Number of IDs in basket
				var IDsNum = new Array();
				IDsNum = MyForm.SubCategorys.value.split('$,$');
				
				if(IDsNum.length>4)
				{
					alert("לא ניתן לבחור יותר מ-5 סיווגים");
					return false;
				}
				
				var is_protocol_ok=MyForm.SubCategorys.value.indexOf('$'+temp[0]+'$');
				if (is_protocol_ok==-1)
				{
					MyForm.SubCategorys.value = MyForm.SubCategorys.value + ",$"+ temp[0] +"$";
				}
				else
				{
					alert("הסיווג שבחרת כבר קיים ברשימת הסיווגים");
					return false;
				}	
				
			}
			else
			{
				MyForm.SubCategorys.value = "$"+ temp[0] +"$";
			}
			// ************************************************************************
			
			if (MyForm.SubCategorysString.value!="")
			{
				MyForm.SubCategorysString.value = MyForm.SubCategorysString.value +",#"+ SubCategory +"#";
			}
			else
			{
				MyForm.SubCategorysString.value = "#"+ SubCategory +"#";
			}	
			
			// SubCategorys IDs & Names
			var SubCategoryListStr = MyForm.SubCategorysString.value;
			SubCategoryListStr = SubCategoryListStr.replace(/#/g, "");
			
			var temp1 = new Array();
			temp1 = SubCategoryListStr.split(',');
			var SubCategoryStr = "";
			
			for (var i=0;i<temp1.length;i++) 
			{	
				var SubCategory = new Array();
				var SubCategory = temp1[i].split('@');
				
				if (temp1[i]!="")
				{
					SubCategoryStr = SubCategoryStr + "<div class='SubCategoryItem'>"+ SubCategory[1] +"&nbsp;&nbsp;<a href='javascript:void(0);' onclick='RemoveSubCategory("+ SubCategory[0] +");'>הסר</a></div>"
				}	
			}
			
			
			document.getElementById('SubCategorysList').innerHTML = SubCategoryStr;
		}
		else
		{
			alert("יש לבחור סיווג להוספה לרשימה");
		}	
	}
	
	function RemoveSubCategory(ID)
	{
	var MyForm = document.forms["AddForm"];
	var Str
	Str = MyForm.SubCategorysString.value;
	var NewStr = ""
	var temp1 = new Array();
	temp1 = Str.split(',');
	var strID = "#"+ID+"@"
	
		for (var i=0;i<temp1.length;i++) 
		{	
			if (temp1[i].indexOf(strID)<0)
			{
				NewStr = NewStr + "," + temp1[i]
			}
		}
		MyForm.SubCategorysString.value = NewStr;
		
	
	var Str1
	Str1 = MyForm.SubCategorys.value;
	
	var NewStr1 = ""
	var temp2 = new Array();
	temp2 = Str1.split(',');
	var strID1 = "$"+ID+"$"
	
		for (var i=0;i<temp2.length;i++) 
		{	
			
			if (temp2[i].indexOf(strID1)<0 && temp2[i]!="")
			{
				NewStr1 = NewStr1 + "," + temp2[i]
			}
			
		}
		MyForm.SubCategorys.value = NewStr1;	
		
		// SubCategorys IDs & Names
			var SubCategoryListStr = MyForm.SubCategorysString.value;
		if (SubCategoryListStr!="")
		{
			SubCategoryListStr = SubCategoryListStr.replace(/#/g, "");
			
			var temp3 = new Array();
			temp3 = SubCategoryListStr.split(',');
			var SubCategoryStr = "";
			
			for (var i=0;i<temp3.length;i++) 
			{	
				var SubCategory = new Array();
				var SubCategory = temp3[i].split('@');
				if (temp3[i]!="")
				{
					SubCategoryStr = SubCategoryStr + "<div class='SubCategoryItem'>"+ SubCategory[1] +"&nbsp;&nbsp;<a href='javascript:void(0);' onclick='RemoveSubCategory("+ SubCategory[0] +");'>הסר</a></div>"
				}	
				
			}
		}	
		else
		{
			SubCategoryStr = "";
		}
			document.getElementById('SubCategorysList').innerHTML = SubCategoryStr;
	}
//*********************************************************************************************************************
// ניהול אזורי שירות
function AddAreas()
	{
		var MyForm = document.forms["AddForm"];
		// ----------------------------------------------------------------- //
		// ***************************************************************** //
		// MyForm.Areas.value - Send this value to the insert page //
		// ***************************************************************** //
		// ----------------------------------------------------------------- //
		
		var Area = MyForm.Area.options[MyForm.Area.selectedIndex].value;
		if (Area!="")
		{
			var temp = new Array();
			temp = Area.split('@');
			
			
			// Areas IDs *****************************************************
			if (MyForm.Areas.value!="")
			{
				
				// Check Number of IDs in basket
				var IDsNum = new Array();
				IDsNum = MyForm.Areas.value.split('$,$');
				
				if(IDsNum.length>4)
				{
					alert("לא ניתן לבחור יותר מ-5 אזורים");
					return false;
				}
				
				var is_protocol_ok=MyForm.Areas.value.indexOf('$'+temp[0]+'$');
				if (is_protocol_ok==-1)
				{
					MyForm.Areas.value = MyForm.Areas.value + ",$"+ temp[0] +"$";
				}
				else
				{
					alert("האזור שבחרת כבר קיים ברשימת האזורים");
					return false;
				}	
				
			}
			else
			{
				MyForm.Areas.value = "$"+ temp[0] +"$";
			}
			// ************************************************************************
			
			if (MyForm.AreasString.value!="")
			{
				MyForm.AreasString.value = MyForm.AreasString.value +",#"+ Area +"#";
			}
			else
			{
				MyForm.AreasString.value = "#"+ Area +"#";
			}	
			
			// Areas IDs & Names
			var AreaListStr = MyForm.AreasString.value;
			AreaListStr = AreaListStr.replace(/#/g, "");
			
			var temp1 = new Array();
			temp1 = AreaListStr.split(',');
			var AreaStr = "";
			
			for (var i=0;i<temp1.length;i++) 
			{	
				var Area = new Array();
				var Area = temp1[i].split('@');
				
				if (temp1[i]!="")
				{
					AreaStr = AreaStr + "<div class='SubCategoryItem'>"+ Area[1] +"&nbsp;&nbsp;<a href='javascript:void(0);' onclick='RemoveArea("+ Area[0] +");'>הסר</a></div>"
				}	
			}
			
			
			document.getElementById('AreasList').innerHTML = AreaStr;
		}
		else
		{
			alert("יש לבחור אזור להוספה לרשימה");
		}	
	}
	
	function RemoveArea(ID)
	{
	var MyForm = document.forms["AddForm"];
	var Str
	Str = MyForm.AreasString.value;
	var NewStr = ""
	var temp1 = new Array();
	temp1 = Str.split(',');
	var strID = "#"+ID+"@"
	
		for (var i=0;i<temp1.length;i++) 
		{	
			if (temp1[i].indexOf(strID)<0)
			{
				NewStr = NewStr + "," + temp1[i]
			}
		}
		MyForm.AreasString.value = NewStr;
		
	
	var Str1
	Str1 = MyForm.Areas.value;
	
	var NewStr1 = ""
	var temp2 = new Array();
	temp2 = Str1.split(',');
	var strID1 = "$"+ID+"$"
	
		for (var i=0;i<temp2.length;i++) 
		{	
			
			if (temp2[i].indexOf(strID1)<0 && temp2[i]!="")
			{
				NewStr1 = NewStr1 + "," + temp2[i]
			}
			
		}
		MyForm.Areas.value = NewStr1;	
		
		// Areas IDs & Names
			var AreaListStr = MyForm.AreasString.value;
		if (AreaListStr!="")
		{
			AreaListStr = AreaListStr.replace(/#/g, "");
			
			var temp3 = new Array();
			temp3 = AreaListStr.split(',');
			var AreaStr = "";
			
			for (var i=0;i<temp3.length;i++) 
			{	
				var Area = new Array();
				var Area = temp3[i].split('@');
				if (temp3[i]!="")
				{
					AreaStr = AreaStr + "<div class='SubCategoryItem'>"+ Area[1] +"&nbsp;&nbsp;<a href='javascript:void(0);' onclick='RemoveArea("+ Area[0] +");'>הסר</a></div>"
				}	
				
			}
		}	
		else
		{
			AreaStr = "";
		}
			document.getElementById('AreasList').innerHTML = AreaStr;
	}



///פונקציות למערכים *********************************************************************************
function Match1(ManufID,ModelId){
		this.ManufID=ManufID;
		this.Model=ModelId;
}			

function Add_Model1(val,txt){
	this.value = val;
	this.text = txt;
}

function CheckLength1()
{


var ObjModel = this.ModelID;

	if(ObjModel.options.length<2){
		ObjModel.disabled=true;
		ObjModel.selectedIndex =-1
		ObjModel.options[0].text=""


		ObjModel.style.backgroundColor="#c0c0c0"	
	}else{
		ObjModel.style.backgroundColor="white"	
		ObjModel.options[0].text="Please select"
		ObjModel.selectedIndex = 0

		ObjModel.disabled=false;
	}

}

function ShowModels1(form)
{
	var vcPrimaryManufBox = form.Category ;
	
	var ObjModel = form.SubCategory;
	var i=0,i1=0,i2=0;
	var TmpStr;
	var vcPrimaryManufs = new Array;
		TmpArr = new Array;
		tmp=new Array;
	ObjModel.selectedIndex = 0 ;

	for(i=ObjModel.options.length-1;i>0;i--) 
	{
		ObjModel.options[i] = null;
	}

	selected_vcPrimaryManuf=(vcPrimaryManufBox.options.selectedIndex!=-1)? vcPrimaryManufBox.options[vcPrimaryManufBox.options.selectedIndex].value : 0;

	for (i=0; i < vcPrimaryManufBox.options.length ;i++)
	{
		if (vcPrimaryManufBox.options[i].selected)
		{
			vcPrimaryManufs[i1]=vcPrimaryManufBox.options[i].value;
		 	i1++;
		}
	}
	
	
	i=0;
	var j=1;
	for (i2=0;i2<vcPrimaryManufs.length;i2++)
	{					
		while (ModelByManuf[i].ManufID != vcPrimaryManufs[i2])
			if (i < ModelByManuf.length-1) i++;
			else {return;}	
		i1=0;
		while (ModelByManuf[i].ManufID ==  vcPrimaryManufs[i2] && i1<Model.length)
		{						
			if (Model[i1].value == ModelByManuf[i].Model)
			{
				TmpStr = TmpArr.join(' ,');
				if ((TmpStr.indexOf(' ,'+Model[i1].value)==-1) && (TmpStr.indexOf(Model[i1].value+' ,')==-1))
				{
					TmpArr[j-1] = Model[i1].value;
					ObjModel.options[j] = new Option(Model[i1].text,Model[i1].value);
					j++;
				}
				i++;
			}
				

			if(i<Model.length)
				i1++;
			else 
				{
				return;
				}
		}
	}


}
//*********************************************************************************************************************

//**********************************************************************************//

function ShowHideProfessionalAds(AdID,AdType)
{
/* if (eval("document.getElementById('AllText" + AdID + "')"))*/
if (eval("document.all.AllText"+ AdID))
	{
		str="<iframe src='../Professional/ShowDetails.asp?Luach=Professional&AdID="+ AdID+"&More=' width='622' height='265' frameborder='0' scrolling='no'></iframe>";
		document.getElementById("ShortText"  + AdID).style.display="none";
		document.getElementById("DetailsBottom"  + AdID).style.display="none";
		document.getElementById("Details"  + AdID).style.height="25px";
		var OpenBottomStr = "";
			/* OpenBottomStr = OpenBottomStr + "<div class='AdsenseDivAdDetails'>";
			OpenBottomStr = OpenBottomStr + "<script type='text/javascript'>";
			OpenBottomStr = OpenBottomStr + "google_ad_client = 'pub-1905118637660260';";
			OpenBottomStr = OpenBottomStr + "google_ad_slot = '2685537567';";
			OpenBottomStr = OpenBottomStr + "google_ad_width = 728;";
			OpenBottomStr = OpenBottomStr + "google_ad_height = 90;";
			OpenBottomStr = OpenBottomStr + "</script>";
			OpenBottomStr = OpenBottomStr + "<script type='text/javascript'";
			OpenBottomStr = OpenBottomStr + "src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>";
			OpenBottomStr = OpenBottomStr + "</script>";
			OpenBottomStr = OpenBottomStr + "</div>" ; */
			OpenBottomStr = OpenBottomStr + "<div class='ORight'>";
			OpenBottomStr = OpenBottomStr + "<a href=javascript:NewWindow('ShowAdsProfessional.asp?Luach=Professional&AdID="+ AdID+"',700,357,0,10);><img src='../Images/Ads/Professional/ProPrintIcon.png' align='absmiddle' alt='הדפסת מודעה'> הדפסת מודעה</a>&nbsp;&nbsp;&nbsp;"
			OpenBottomStr = OpenBottomStr + "</div>"
			OpenBottomStr = OpenBottomStr + "<div class='OLeft'><a href='javascript:void(0);' onclick='CloseProfessionalAd("+ AdID+","+ AdType +"); return false;'><img src='../Images/Ads/Professional/ProCloseDetailsIcon.png' align='absmiddle' alt='סגירת מודעה'> סגירת מודעה</a>&nbsp;</div>"

		document.getElementById("Show"  + AdID).innerHTML=str;
		eval("document.all.AllText"+ AdID + ".style.display=''")
		/* eval("document.getElementById('AllText" + AdID + "')" + ".style.display=''") */

		if(AdType!=1)
		{
			eval("AdTopR" + AdID + ".className=AdTopR" + AdID + ".className.replace('AdTopR','AdTopROpen')")
			document.getElementById("AdTopR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopRCornerOpen.gif'>";

			eval("AdTopM" + AdID + ".className=AdTopM" + AdID + ".className.replace('AdTopM','AdTopMOpen')")
			document.getElementById("AdTopM"  + AdID).innerHTML = "&nbsp;";

			eval("AdTopL" + AdID + ".className=AdTopL" + AdID + ".className.replace('AdTopL','AdTopLOpen')")
			document.getElementById("AdTopL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopLCornerOpen.gif'>";
		
			document.getElementById("AdM"  + AdID).style.paddingTop = "10px";
		
			eval("AdBottomR" + AdID + ".className=AdBottomR" + AdID + ".className.replace('AdBottomR','BottomCornerR')")
			document.getElementById("AdBottomR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomRCornerOpen.gif'>";

			eval("AdBottomM" + AdID + ".className=AdBottomM" + AdID + ".className.replace('AdBottomM','AdBottomMOpen')")
			document.getElementById("AdBottomM"  + AdID).innerHTML = OpenBottomStr;

			eval("AdBottomL" + AdID + ".className=AdBottomL" + AdID + ".className.replace('AdBottomL','BottomCornerL')")
			document.getElementById("AdBottomL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomLCornerOpen.gif'>";
		}
		else
		{
		
			eval("AdTopR" + AdID + ".className=AdTopR" + AdID + ".className.replace('AdTopR1','AdTopROpen')")
			document.getElementById("AdTopR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopRCornerOpen.gif'>";

			eval("AdTopM" + AdID + ".className=AdTopM" + AdID + ".className.replace('AdTopM1','AdTopMOpen')")
			document.getElementById("AdTopM"  + AdID).innerHTML = "&nbsp;";

			eval("AdTopL" + AdID + ".className=AdTopL" + AdID + ".className.replace('AdTopL1','AdTopLOpen')")
			document.getElementById("AdTopL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopLCornerOpen.gif'>";
		
			eval("AdM" + AdID + ".className=AdM" + AdID + ".className.replace('AdM1','AdM')")
			document.getElementById("AdM"  + AdID).style.paddingTop = "10px";
			eval("AdR" + AdID + ".className=AdR" + AdID + ".className.replace('AdR1','AdR')")
			eval("AdL" + AdID + ".className=AdL" + AdID + ".className.replace('AdL1','AdL')")
			
			eval("AdBottomR" + AdID + ".className=AdBottomR" + AdID + ".className.replace('AdBottomR1','BottomCornerR')")
			document.getElementById("AdBottomR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomRCornerOpen.gif'>";

			eval("AdBottomM" + AdID + ".className=AdBottomM" + AdID + ".className.replace('AdBottomM1','AdBottomMOpen')")
			document.getElementById("AdBottomM"  + AdID).innerHTML = OpenBottomStr;

			eval("AdBottomL" + AdID + ".className=AdBottomL" + AdID + ".className.replace('AdBottomL1','BottomCornerL')")
			document.getElementById("AdBottomL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomLCornerOpen.gif'>";
		}
		
		document.getElementById("Details"  + AdID).style.color = "#000000";
	}
}

function CloseProfessionalAd(AdID,AdType)
{
	document.getElementById("ShortText"  + AdID).style.display="";
	document.getElementById("DetailsBottom"  + AdID).style.display="";
	document.getElementById("Details"  + AdID).style.height="92px";
	
	if(AdType!=1)
		{
			eval("AdTopR" + AdID + ".className=AdTopR" + AdID + ".className.replace('AdTopROpen','AdTopR')")
			document.getElementById("AdTopR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopRCorner.gif'>";

			eval("AdTopM" + AdID + ".className=AdTopM" + AdID + ".className.replace('AdTopMOpen','AdTopM')")
			document.getElementById("AdTopM"  + AdID).innerHTML = "&nbsp;";

			eval("AdTopL" + AdID + ".className=AdTopL" + AdID + ".className.replace('AdTopLOpen','AdTopL')")
			document.getElementById("AdTopL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopLCorner.gif'>";
	
			document.getElementById("AdM"  + AdID).style.paddingTop = "0px";
	
			eval("AdBottomR" + AdID + ".className=AdBottomR" + AdID + ".className.replace('BottomCornerR','AdBottomR')")
			document.getElementById("AdBottomR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomRCorner.gif'>";

			eval("AdBottomM" + AdID + ".className=AdBottomM" + AdID + ".className.replace('AdBottomMOpen','AdBottomM')")
			document.getElementById("AdBottomM"  + AdID).innerHTML = "&nbsp;";

			eval("AdBottomL" + AdID + ".className=AdBottomL" + AdID + ".className.replace('BottomCornerL','AdBottomL')")
			document.getElementById("AdBottomL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomLCorner.gif'>";
		}
		else
		{
			eval("AdTopR" + AdID + ".className=AdTopR" + AdID + ".className.replace('AdTopROpen','AdTopR1')")
			document.getElementById("AdTopR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopRCorner1.gif'>";

			eval("AdTopM" + AdID + ".className=AdTopM" + AdID + ".className.replace('AdTopMOpen','AdTopM1')")
			document.getElementById("AdTopM"  + AdID).innerHTML = "&nbsp;";

			eval("AdTopL" + AdID + ".className=AdTopL" + AdID + ".className.replace('AdTopLOpen','AdTopL1')")
			document.getElementById("AdTopL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/TopLCorner1.gif'>";
	
			eval("AdM" + AdID + ".className=AdM" + AdID + ".className.replace('AdM','AdM1')")
			document.getElementById("AdM"  + AdID).style.paddingTop = "0px";
			eval("AdR" + AdID + ".className=AdR" + AdID + ".className.replace('AdR','AdR1')")
			eval("AdL" + AdID + ".className=AdL" + AdID + ".className.replace('AdL','AdL1')")
	
			eval("AdBottomR" + AdID + ".className=AdBottomR" + AdID + ".className.replace('BottomCornerR','AdBottomR1')")
			document.getElementById("AdBottomR"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomRCorner1.gif'>";

			eval("AdBottomM" + AdID + ".className=AdBottomM" + AdID + ".className.replace('AdBottomMOpen','AdBottomM1')")
			document.getElementById("AdBottomM"  + AdID).innerHTML = "&nbsp;";

			eval("AdBottomL" + AdID + ".className=AdBottomL" + AdID + ".className.replace('BottomCornerL','AdBottomL1')")
			document.getElementById("AdBottomL"  + AdID).innerHTML = "<img src='../Images/Ads/Professional/BottomLCorner1.gif'>";
		}
	document.getElementById("Details"  + AdID).style.color = "#a9a9a9";
	

	document.getElementById("Show"  + AdID).innerHTML="";
	eval("AllText" + AdID + ".style.display='none'")
}

function CheckProfessionalSearch()
{
	var check = true;
	if (document.Search.Category.value != "" && document.Search.Category.value != "0")
	{
		if (document.Search.SubCategory.value == "" || document.Search.SubCategory.value == "0")
		{
			check = false; 
			alert("נא לבחור סיווג");
			document.Search.SubCategory.focus();
		}
	}
	if (check)
	{
		return true
	}
	return false;
}