var clockID = 0;
var SearchEngineTableBg0 = new Image();
var SearchEngineTableBg1 = new Image();
var SearchEngineTableBg2 = new Image();
var SearchEngineTableBg3 = new Image();
SearchEngineTableBg0.src = 'secure/images/Search/SearchBg_0.gif';
SearchEngineTableBg1.src = 'secure/images/Search/SearchBg_1.gif';
SearchEngineTableBg2.src = 'secure/images/Search/SearchBg_2.gif';
SearchEngineTableBg3.src = 'secure/images/Search/SearchBg_3.gif';
var LastOpen = 0;

function SearchAllArea(){
	document.forms[0].Location.selectedIndex=0;
	document.forms[0].submit();
}

function ShowTbl(obj){

	var myObj;
	for(i=1;i<=15;i++){
		myObj = eval("Tbl" + i);
		myObj.style.display = 'none';
	}
	obj.style.display = 'block';
}

function DoSend(Name, ID, Modul){
	if(Modul=='Yad2')
		location='mailto:?Subject='+ Name + '&Body=תראה מה מצאתי ב%20www.clickgo.co.il.%0D%0Aנראה לי הלינק הבא יכול לעניין אותך:%20www.clickgo.co.il/Yad2Search.asp%3FID%3D'+ID
	else
		if(Modul=='Biz Article')
			location='mailto:?Subject='+ Name + '&Body=תראה מה מצאתי ב%20www.clickgo.co.il.%0D%0Aנראה לי הלינק הבא יכול לעניין אותך:%20www.clickgo.co.il/ArticleSearch.asp%3FID%3D'+ID
		else
			location='mailto:?Subject='+ Name + '&Body=תראה מה מצאתי ב%20www.clickgo.co.il.%0D%0Aנראה לי הלינק הבא יכול לעניין אותך:%20www.clickgo.co.il/BizSearch.asp%3FID%3D'+ID
}

function OpenWindow(Path){
	a = window.open(Path, 'popUp', 'width=600, height=500, scrollbars=1, resizable=0, status=yes')
	a.focus();
}


function OpenWindowW(Path){
	a = window.open(Path, 'popUp', 'width=400, height=400, scrollbars=0, resizable=0, status=yes')
	a.focus();
}

function OpenWindowT(){
	a = window.open("https://secure.tranzila.com/verified/info.php?248158648611472130&mm=web2000.netvision.net.il&lng=HEB", 'popUp', 'width=380, height=470, scrollbars=0, resizable=0, status=no')
	a.focus();
}
function OpenMiniSite(Path, WindowParams){
	a = window.open("MiniSite.asp?Src=" + Path, "popUp", WindowParams)
	a.focus();
}

function openWindowSample(Path){
	a = window.open(Path, 'popUp', 'width=750, height=510, scrollbars=0, resizable=1, status=no')
	a.focus();
}

function setForm_old(opt){
	if(opt){

		document.images.TAB1.src=document.images.TAB1.src.replace('03.gif', '03o.gif');
		document.images.TAB0.src=document.images.TAB0.src.replace('04.gif', '04o.gif');
		try{document.images.Animation.src=document.images.Animation.src.replace('ClickAsakim.gif', 'ClickDrushim.gif');}catch(er){}
		document.SearchForm.action="JobSearch.asp";
		UnderText.innerHTML = "תחום, משרה, או מקצוע";
	}else{
		document.images.TAB1.src=document.images.TAB1.src.replace('03o.gif', '03.gif');
		document.images.TAB0.src=document.images.TAB0.src.replace('04o.gif', '04.gif');
		try{document.images.Animation.src=document.images.Animation.src.replace('ClickDrushim.gif', 'ClickAsakim.gif');}catch(er){}
		UnderText.innerHTML = "תחום, סיווג, מוצר או שם בית עסק";
		document.SearchForm.action="BizSearch.asp";
	}
}


function setForm(opt){
	setFormNew(opt)
	if(0){
	var ActionArray = new Array();
	ActionArray[0] = SitePath + "BizSearch.asp"
	ActionArray[1] = SitePath + "JobSearch.asp"
	ActionArray[2] = SitePath + "Yad2Search.asp"
	ActionArray[3] = SitePath + "ArticleSearch.asp"
	SearchEngineTable.background = '/secure/images/Search/SearchBg_' + opt + '.gif'
	document.SearchForm.action = ActionArray[opt]
	try{
		document.getElementById("AddCategory30").style.display = 'none';
	}catch(er){}
	if(opt==2){
		document.getElementById("AddCategory0").style.display = 'none';
		document.getElementById("AddCategory1").style.display = 'inline';
		document.getElementById("AddCategory2").style.display = 'inline';
		document.getElementById("AddCategory3").style.display = 'none';
	}else{
		if(opt==3){
			document.getElementById("AddCategory0").style.display = 'none';
			document.getElementById("AddCategory1").style.display = 'none';
			document.getElementById("AddCategory2").style.display = 'none';
			document.getElementById("AddCategory3").style.display = 'inline';
		}else{
			document.getElementById("AddCategory0").style.display = 'inline';
			document.getElementById("AddCategory1").style.display = 'inline';
			document.getElementById("AddCategory2").style.display = 'none';
			document.getElementById("AddCategory3").style.display = 'none';
		}		
	}
	try{
		if(opt==0){
			document.getElementById("AddCategory30").style.display = 'inline';
		}
	}catch(er){}
	document.SearchForm.SearchFor.focus();
	}
}

function setFormNew(opt){
	var ActionArray = new Array();
	ActionArray[0] = SitePath + "BizSearch.asp"
	ActionArray[1] = SitePath + "JobSearch.asp"
	ActionArray[2] = SitePath + "Yad2Search.asp"
	ActionArray[3] = SitePath + "ArticleSearch.asp"
	for(i=0;i<4;i++){
		myTD = eval("document.getElementById('SearchEngineTD"  + i +"')");
		myTD.bgColor = "#ffffff"
		myTD.style.border = 'none';
		myTD.style.borderBottom = '1px solid #DE3333';
	}
	myTD = eval("document.getElementById('SearchEngineTD"  + opt +"')");
	myTD.bgColor = "#C0C0C0";
	myTD.style.borderRight = '1px solid #DE3333';
	myTD.style.borderTop = '1px solid #DE3333';
	myTD.style.borderLeft = '1px solid #DE3333';
	myTD.style.borderBottom = 'none';

	document.SearchForm.action = ActionArray[opt]
	if(opt==2){
		//document.getElementById("AddCategory0").style.display = 'none';
		document.getElementById("AddCategory1").style.display = 'inline';
		document.getElementById("AddCategory2").style.display = 'inline';
		//document.getElementById("AddCategory3").style.display = 'none';
	}else{
		if(opt==3){
			//document.getElementById("AddCategory0").style.display = 'none';
			document.getElementById("AddCategory1").style.display = 'none';
			document.getElementById("AddCategory2").style.display = 'none';
			//document.getElementById("AddCategory3").style.display = 'inline';
		}else{
			//document.getElementById("AddCategory0").style.display = 'inline';
			document.getElementById("AddCategory1").style.display = 'inline';
			document.getElementById("AddCategory2").style.display = 'none';
			//document.getElementById("AddCategory3").style.display = 'none';
		}		
	}
	try{
		if(opt==0){
			document.getElementById("AddCategory30").style.display = 'inline';
		}
	}catch(er){}
	document.SearchForm.SearchFor.focus();
}

function setForm2007Old(opt){
	var ActionArray = new Array();
	ActionArray[0] = SitePath + "BizSearch.asp"
	ActionArray[1] = SitePath + "JobSearch.asp"
	ActionArray[2] = SitePath + "Yad2Search.asp"
	ActionArray[3] = SitePath + "ArticleSearch.asp"
	for(i=0;i<4;i++){
		myTD = eval("document.getElementById('ActiveLink"  + i +"')");
		myTD.style.fontWeight = "normal"
		myTD.style.color = "#555555"
		myTD.style.textDecoration = "none"
	}
	myTD = eval("document.getElementById('ActiveLink"  + opt +"')");
	myTD.style.fontWeight = "Bold";
	myTD.style.color = "#C01E15"
	myTD.style.textDecoration = "underline"
	document.SearchForm.action = ActionArray[opt]
	if(opt==2){
		document.getElementById("AddCategory1").style.display = 'inline';
		document.getElementById("AddCategory2").style.display = 'inline';
	}else{
		if(opt==3){
			document.getElementById("AddCategory1").style.display = 'none';
			document.getElementById("AddCategory2").style.display = 'none';
		}else{
			document.getElementById("AddCategory1").style.display = 'inline';
			document.getElementById("AddCategory2").style.display = 'none';
		}		
	}
	try{
		if(opt==0){
			document.getElementById("AddCategory30").style.display = 'inline';
		}
	}catch(er){}
//	document.SearchForm.SearchFor.focus();
}


function setForm2007_old1(opt){
	var ActionArray = new Array();
	ActionArray[0] = SitePath + "BizSearch.asp"
	ActionArray[1] = SitePath + "JobSearch.asp"
	ActionArray[2] = SitePath + "Yad2Search.asp"
	ActionArray[3] = SitePath + "ArticleSearch.asp"
	for(i=0;i<4;i++){
		myTD = eval("document.getElementById('ActiveLink"  + i +"')");
		myTD.style.fontWeight = "normal"
		myTD.style.color = "#555555"
		myTD.style.textDecoration = "none"
	}


	myTD = eval("document.getElementById('ActiveLink"  + opt +"')");
	myTD.style.fontWeight = "Bold";
	myTD.style.color = "#C01E15"
	myTD.style.textDecoration = "underline"
	document.SearchForm.action = ActionArray[opt]
	if(opt==2){
		document.SearchForm.Location.disabled= false;
		document.SearchForm.Name.disabled= false;

	}else{
		if(opt==3){
			document.SearchForm.Location.disabled= true;;
			document.SearchForm.Name.disabled= true;
		}else{
			document.SearchForm.Location.disabled= false;

			document.SearchForm.Name.disabled= true;
		}		
	}
	try{
		if(opt==0){
			document.getElementById("AddCategory30").disabled= false;


		}
	}catch(er){}
//	document.SearchForm.SearchFor.focus();
}

function setForm2007(opt){
	var ActionArray = new Array();
	ActionArray[0] = SitePath + "BizSearch.asp"
	ActionArray[1] = SitePath + "JobSearch.asp"
	ActionArray[2] = SitePath + "Yad2Search.asp"
	ActionArray[3] = SitePath + "ArticleSearch.asp"

	document.SearchForm.action = ActionArray[opt]
	if(opt==2){
		document.SearchForm.Location.disabled= false;
		document.SearchForm.Name.disabled= false;

	}else{
		if(opt==3){
			document.SearchForm.Location.disabled= true;;
			document.SearchForm.Name.disabled= true;
		}else{
			document.SearchForm.Location.disabled= false;

			document.SearchForm.Name.disabled= true;
		}		
	}
	try{
		if(opt==0){
			document.getElementById("AddCategory30").disabled= false;


		}
	}catch(er){}
	for(i=0;i<document.SearchForm.section.length;i++){
		if(document.SearchForm.section[i].value==opt)
			document.SearchForm.section[i].selected=true;
		else
			document.SearchForm.section[i].selected=false;
	}
}

 function setAdd1Form(opt){
	if(opt==0){
		document.AddForm.Month.value=12;
		document.AddForm.sum.value=430;
		document.AddForm.PubLength.value='שנה';
	}
	if(opt==1){
		document.AddForm.Month.value=12;
		document.AddForm.sum.value=490;
		document.AddForm.PubLength.value='שנה';
	}
	if(opt==2){
		document.AddForm.Month.value=12;
		document.AddForm.sum.value=0;
		document.AddForm.PubLength.value='שנה';
	}
}

function SetMMYY(Form){
	Form.expdate.value= '' + Form.expmonth.value + Form.expyear.value;
}

function setAddForm(opt){

	for(i=1;i<10;i++){
		Tbl = eval('Tbl' + i);
		Inpt = eval('document.getElementById("Inpt' + i + '")');
		if(opt)
			if(!(i==2||i==9)){
				Tbl.style.display='none'	
				Inpt.disabled = true;
			}else{
				PhoneTitle.style.color='#3B3532'
				document.getElementById("PhoneInpt").title = ''
				Tbl.style.display='block'	
				Inpt.disabled = false;
			}
		else
			if(!(i==2||i==9)){
				Tbl.style.display='block'	
				Inpt.disabled = false;
			}else{
				PhoneTitle.style.color='#C01E15'
				document.getElementById("PhoneInpt").title = '*** טלפון ראשי - שדה חובה ***'
				Tbl.style.display='none'	
				Inpt.disabled = true;
			}
	}
}

function CheckForm(Form){
	if(Form.Location.value=='' && (Trim(Form.SearchFor.value)=='')){
		alert('יש להזין מילת חיפוש או לבחור אזור');
		Form.SearchFor.focus();
		return;
	}
	Form.submit();
}

function CheckAddForm1(Form){
	for(i=1;i<Form.length;i++){
		if(Form[i].name!='KeyWord1' && Form[i].name!='KeyWord2')
			Form[i].style.borderColor='#3B3532';
		if(Form[i].title.indexOf('*')>-1 && Form[i].value.length<1 && Form[i].disabled==false){
			alert(Form[i].title)
			Form[i].focus();
			if(Form[i].name=='Location')
				 self.scrollTo(0, 310);
			Form[i].style.borderColor='#C01E15';
			return;
		}
	}
	if(Form.PasswordConfirm.value!=Form.Password.value){

		alert('*** אימות הסיסמא אינו תואם את הסיסמא - נסה שנית ***')
		Form.PasswordConfirm.value = Form.Password.value = '';
		Form.Password.focus();
		return;
	}
	Form.submit();
}


function CheckAddForm2(Form){
	for(i=1;i<Form.length;i++){
		Form[i].style.borderColor='#3B3532';
		if(Form[i].title.indexOf('*')>-1 && Form[i].value.length<1 && Form[i].disabled==false){
			alert(Form[i].title)
			Form[i].focus();
			Form[i].style.borderColor='#C01E15';
			return;
		}
	}

 
	if(Form.CardType.value=='2'){
		if(!VerifyIsracard(Form.ccno.value)){
			alert("*** מספר כרטיס האשראי (ישראכרט) אינו תקין, חסר או לא חוקי - נסה שנית ***")
			Form.ccno.focus();
			return;
		}
	}else{
		if(!VerifyNumber(Form.ccno.value, 'CC')){
			alert("*** מספר כרטיס האשראי אינו תקין, חסר או לא חוקי - נסה שנית ***")
			Form.ccno.focus();
			return;
		}
	}
	if(!VerifyNumber(Form.myid.value, 'IdNum')){
		alert("מספר תעודת הזהות אינו תואם את ספרת הביקורת או אינו חוקי, יש להזין" + "\n" + "מספר תעודת זהות בן 9 ספרות הכולל אפסים מובילים וספרת ביקורת")
		Form.myid.focus();
		return;
	}
	Form.submit();
}

function CheckUpdateForm(Form){
	for(i=0;i<Form.length;i++){
		Form[i].style.borderColor='#3B3532';
		if(Form[i].title.indexOf('*')>-1 && Form[i].value.length<1 && Form[i].disabled==false){
			alert(Form[i].title)
			Form[i].focus();
			Form[i].style.borderColor='#C01E15';
			return;
		}
	}
	Form.submit();
}

function ChangeAction(Form, Act){
	Form.ID.style.borderColor='#3B3532';
	if(Form.ID.value.length<1){
		alert(Form.ID.title)
		Form.ID.focus();
		Form.ID.style.borderColor='#C01E15';
		return;
	}
		
	Form.action = Act;
	Form.submit();
}


function VerifyNumber(str, typ)
{
	var AddMishkal, TempResult, TotalResult;
	if ((str.length!=9 || isNaN(str) || str*1==0) && typ=='IdNum')
		return (false); //ID NOUM IS NOT VALID 
	if ((str.length<11 || str.length>19) && typ=='CC')
		return (false); //CC IS NOT VALID
	strArray = str.split('');
	strArray = strArray.reverse()
	TotalResult = 0;
	for(i=0;i<strArray.length;i++)
	{
		if(AddMishkal==1)
			AddMishkal = 2;
		else
			AddMishkal = 1;
		strArray[i] = (strArray[i]*AddMishkal).toString()
		JoinResultArray = strArray[i].split('');
		TempResult = 0;
		for(j=0;j<JoinResultArray.length;j++)
		{
			TempResult += (JoinResultArray[j]*1)
		}
		strArray[i] = TempResult;
		TotalResult +=  (TempResult*1);
	}
	str='';
	if(TotalResult%10>0)
		return (false) //Number IS NOT OK 
	else
		return (true) //Number IS OK 
}



function VerifyIsracard(str)
{
	var AddMishkal, TempResult, TotalResult;
	if (str.length<8 || str.length>9 || isNaN(str) || str*1==0)
		return (false); //Isracard IS NOT VALID 
	if (str.length<9)
	str = '0' + str
	strArray = strArray.reverse()
	TotalResult = 0;
	for(i=0;i<strArray.length;i++)
	{
		AddMishkal = 9-i;
		strArray[i] = (strArray[i]*AddMishkal).toString()
		JoinResultArray = strArray[i].split('');
		TempResult = 0;
		for(j=0;j<JoinResultArray.length;j++)
		{
			TempResult += (JoinResultArray[j]*1)
		}
		strArray[i] = TempResult;
		TotalResult +=  (TempResult*1);
	}
	str='';
	if(TotalResult%11>0)
		return (false) //Isracard IS NOT VALID 
	else
		return (true) //Isracard IS VALID 
}

function HideOuter(ID){
	outerObjID = eval("document.getElementById('outerTbl" + ID + "')")
	innerObjID = eval("document.getElementById('innerTbl" + ID + "')")
	if(innerObjID.style.display=='none'){
//		outerObjID.background = loseUrl.src;

		outerObjID.style.backgroundColor='';

		outerObjID.style.color='#3B3532';
	}
}
function ShowOuter(ID){
	outerObjID = eval("document.getElementById('outerTbl" + ID + "')");
	outerObjID.style.color='#FFFFFF';
//	if(outerObjID.offsetHeight<25)
//		outerObjID.background = setUrl.src;
//		outerObjID.style.backgroundColor='F04D46';
//	else
//		outerObjID.background = setUrlFat.src;
}

function HideInner_old(ID){
	innerObjID = eval("innerTbl"+ID)
	CheckBox = eval("document.getElementById('MyCheckBox" + ID + "')")
	innerObjID.style.display='none';
	CheckBox.checked=false;
}

function ShowInner_old(ID){
	CheckBox = eval("document.getElementById('MyCheckBox" + ID + "')")
	if(CheckBox.checked==true)
		HideInner(ID)
	else{
		innerObjID = eval("document.getElementById('innerTbl" + ID + "')")
		innerObjID.style.display='block';
		CheckBox.checked=true;
	}
}

function ShowInner(ID){
	try{
	CheckBox = eval("document.getElementById('MyCheckBox" + ID + "')")
	if(CheckBox.checked==true)
		HideInner(ID)
	else{
		innerObjID = eval("document.getElementById('innerTbl" + ID + "')")
		CheckBox.checked=true;
		innerObjID.src = innerObjID.src.replace('&BaseUrl=1', '')
	}
	}catch(er){}
}

function HideInner(ID){
	innerObjID = eval("document.getElementById('innerTbl" + ID + "')")
	CheckBox = eval("document.getElementById('MyCheckBox" + ID + "')")
	innerObjID.style.height = 0;
	innerObjID.src = innerObjID.src + '&BaseUrl=1';
	CheckBox.checked=false;
}


function ShowAllChecked(MaxCheckbox){
	for(i=1;i<=MaxCheckbox;i++){
	CheckBox = eval("document.getElementById('MyCheckBox" + i + "')")
		if(CheckBox.checked==true){
			ShowInner(i);
			ShowInner(i);
		}else{
			outerObjID = eval("outerTbl"+i)
			outerObjID.style.display='none';
		}
	}
	ShowLink.innerHTML = "<B><A HREF='javascript: ShowAll(" + MaxCheckbox +")' Class=WhiteLink>הצג הכל</A></B>"
}

function ShowAll(MaxCheckbox){
	location.reload();
return;	
	
	for(i=1;i<=MaxCheckbox;i++){
		HideInner(i);
		outerObjID = eval("document.getElementById('outerTbl" + i + "')")
		outerObjID.style.display='block';
		HideOuter(i);
		}
//	ShowLink.innerHTML = "<B><A HREF='javascript: ShowAllChecked(" + MaxCheckbox +")' Class=WhiteLink>הצגת מודעות מסומנות</A></B>"
}

function LTrim(str){
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;
		while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
			j++;

		s = s.substring(j, i);
	}
	return s;
}

function RTrim(str){
	var whitespace = new String(" \t\n\r");
	var s = new String(str);
	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;
	while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
		i--;
	s = s.substring(0, i+1);
	}
	return s;
}


function Trim(str){
   return RTrim(LTrim(str));
}


function DoPrint(){
	SP.style.display='none';
	print();
	SP.style.display='block';
}

function ShowCode(){
	document.images.Code.src='images/Order/Code.gif';
}

function HideCode(){
	document.images.Code.src='Images/x.gif';
}

function calcPrice(param1, param2, param3){
	var Mikum1=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum2=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum3=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum4=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum5=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum6=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum7=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum8=new Array(190, 490, 950, 1480, 90, 190, 390, 690, 250, 690, 1190, 1890);
	var Mikum9=new Array(150, 390, 690, 1290, 70, 170, 290, 550, 200, 490, 890, 1490);
	var Mikum10=new Array(150, 390, 690, 1290, 70, 170, 290, 550, 200, 490, 890, 1490);
	ResultArray = eval("Mikum" + param1);
	return(ResultArray[parseInt( param2) + parseInt(param3)] + '$ + מע"מ');
}

function calcBanerPrice(param){
	var BanerPriceArray=new Array(600, 900, 1200, 1500, 1800, 2100, 2400, 2700, 3000, 3150, 3300);
	return(BanerPriceArray[param] + '$ + מע"מ');
}

function calcBanerPrice(param){
	var BanerPriceArray=new Array(600, 900, 1200, 1500, 1800, 2100, 2400, 2700, 3000, 3150, 3300);
	return(BanerPriceArray[param] + '$ + מע"מ');
}


function MediaLiveRadio(urlStr,whichDesc){
	strLink = 'http://bet.iba.org.il/index.asp?classto=10&type=radioLive';
	if (urlStr != ''){
		var mediaUrl = replaceStr(replaceStr(urlStr,"&amp;","ANDSIGN"),"&","ANDSIGN");
		strLink += '&mediaUrl=' + mediaUrl;
	}
	if (whichDesc != ''){
		var sitedesc = replaceStr(whichDesc,"<br>","*br*");
		strLink += '&site_desc=' + sitedesc;
	}
	mediaWindow(strLink)
}

function replaceStr(string,text,by){
	var stringLength = string.length
	var textLength = text.length;
	if ((stringLength == 0) || (textLength == 0))
		return string;
	var i = string.indexOf(text);
	if ((!i) && (text != string.substring(0,textLength)))
		return string;
	if (i == -1)
		return string;
      var newstr = string.substring(0,i) + by;
      if ((i+textLength) < stringLength)
		newstr += replaceStr(string.substring(i+textLength,stringLength),text,by);
      return newstr;
}   

function mediaWindow(strWindowAddrss){
	NewWindowNoresizable(strWindowAddrss,'724','458','no');
}

function NewWindowNoresizable(mypage,w,h,scroll){
	LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=open(mypage,'',settings);
	win.opener=self;
	if(win.focus)
		win.focus();
}

function OpenGlobesRadio(){
	newWin=window.open('http://www.radio-hi.co.il/channel01/Globes.asp','GlobesRadio','left=100,top=100,toolbar=no,scrollbars=no,menu=no,status=no,width=439,height=254');
	newWin.focus()
}


function validate(Form){
	if(Form.File1.value.length<1)
		alert('יש לבחור שם קובץ ואז לשמור');
	else{
		if(document.myImg.fileSize<10){
			alert('תקלה בטעינת הקובץ - יש לבחור שוב קובץ ואז לשמור')
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.fileSize>30000){
			alert('משקל הקובץ שבחרת עולה על המשקל המותר - יש לבחור קובץ עם משקל נמוך מ30 קילובייט');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.mimeType.search('GIF')<0 && document.myImg.mimeType.search('JPEG')<0 && document.myImg.mimeType.search('JPG')<0){
			alert('GIF או JPG/JPEG ' + 'הקובץ שבחרת אינו בפורמט אינטרנט - יש לבחור קבצי ');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.width>250){
			alert('רוחב תמונת הלוגו שבחרת עולה על 250 פיקסלים - יש לבחור לוגו צר יותר');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.height>100){
			alert('גובה תמונת הלוגו שבחרת עולה על 100 פיקסלים - יש לבחור לוגו נמוך יותר');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	

		}

		Form.submit();
	}
}



function validate1(Form){
	if(Form.File1.value.length<1)
		alert('יש לבחור שם קובץ ואז לשמור');
	else{
		if(document.myImg.fileSize<10){
			alert('תקלה בטעינת הקובץ - יש לבחור שוב קובץ ואז לשמור')
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.fileSize>30000){
			alert('משקל הקובץ שבחרת עולה על המשקל המותר - יש לבחור קובץ עם משקל נמוך מ100 קילובייט');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.mimeType.search('GIF')<0 && document.myImg.mimeType.search('JPEG')<0 && document.myImg.mimeType.search('JPG')<0){
			alert('GIF או JPG/JPEG ' + 'הקובץ שבחרת אינו בפורמט אינטרנט - יש לבחור קבצי ');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.width>500){
			alert('רוחב תמונת הלוגו שבחרת עולה על 500 פיקסלים - יש לבחור לוגו צר יותר');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	
		}
		if(document.myImg.height>500){
			alert('גובה תמונת הלוגו שבחרת עולה על 500 פיקסלים - יש לבחור לוגו נמוך יותר');
			Form.reset();
			document.myImg.src = 'images/spacer.gif';
			return;	

		}

		Form.submit();
	}
}


function setPayments(){
	Sum = document.getElementById("sum").value;
	NumberOfPayments = parseInt(document.getElementById("t_npay").value);
	FirstPayment = Sum-(Math.floor(Sum/NumberOfPayments)*(NumberOfPayments-1))
	MonthlyPayment = Math.floor(Sum/NumberOfPayments)
	NumberOfPayments =  NumberOfPayments - 1;
	if(NumberOfPayments>1){
		document.AddForm.spay.disabled = false;
		document.AddForm.fpay.disabled = false;
		document.AddForm.npay.disabled = false;
		document.AddForm.spay.value = MonthlyPayment;
		document.AddForm.fpay.value = FirstPayment;
		document.AddForm.npay.value = NumberOfPayments;
		document.AddForm.cred_type.value= 8;
		document.getElementById("t_spay").value= '₪' + MonthlyPayment;
		if(MonthlyPayment!=FirstPayment && (MonthlyPayment%3>0 || MonthlyPayment%6>0 || MonthlyPayment%9>0 || MonthlyPayment%12>0))
			t_fpay.innerHTML = 'לתשלום הראשון תתווסף תוספת הפרשים על סך' + '₪' +(FirstPayment - MonthlyPayment)
		else
			t_fpay.innerHTML = '&nbsp;';
		
	}else{
		document.getElementById("t_spay").value= '₪' + Sum ;
		document.AddForm.spay.value = 0;
		document.AddForm.fpay.value = 0;
		document.AddForm.npay.value = 0;
		document.AddForm.spay.disabled = true;
		document.AddForm.fpay.disabled = true;
		document.AddForm.npay.disabled = true;
		document.AddForm.cred_type.value= 1;
		t_fpay.innerHTML = '&nbsp;'
	}
//	alert("Sum=" + Sum + "\nNumberOfPayments=" + NumberOfPayments + "\nFirstPayment"+ FirstPayment+ "\nMonthlyPayment"+ MonthlyPayment);
}

function DoMsgbox(Url){
	vARGS = new Array("", "", 2)
	iReturn = showModalDialog(Url, vARGS, "dialogHeight:300px;dialogWidth:430px;center:1;edge:raised;help:0;resizable:0;scroll:0;status:0;" )

}

function ShowBookCover(){
	window.showModalDialog("secure/images/bookpereg.jpg","","dialogHeight: 270px; dialogWidth: 160px; dialogTop: 250px; dialogLeft: 250px; edge: Raised; center: Yes; help: no; resizable: no; status: no;");
}

function RunMarquee(){
	myObj = document.getElementById("ArticleMarquee");
	setTimeout("myObj.scrollAmount=3", 1000);
}

function updatePage( newHeight ){
//	document.getElementById('resizableHeader').height=newHeight;
	document.getElementById('Table_intro').style.display='none';
	document.getElementById('780x257').Play();
	//document.body.scroll = 'auto';
}

function openWindow(param1) {
   window.open("editor/editor.asp?id=" + param1, 'editor', 'width=750, height=510, scrollbars=0, resizable=1, status=no'); 
} 

