function winEdit(strURL,iWidth,iHeight)
{
	window.open(strURL ,'_blank','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=No,Width=' + iWidth + ',Height=' + iHeight)
}



function winOpen(picID,intBoardType)
{
	window.open('InlargePic.asp?picID='+picID + '&BoardType=' + intBoardType,'Picture','location=no,toolbar=no,menubar=no,scrollbars=Auto,resizable=yes,WIDTH=400,HEIGHT=400')
}

// Script: Check Numbers Only
function validate(field) {
	var valid = "0123456789"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") {
			alert("יש להקליד ספרות בלבד!");
			field.focus();
			field.select();
	}
}

// Script: change URL
function GotoLink(str)
{
	top.document.location.href = str
}

// Script: Open Window
function OpenWinLink(strURL,strScroll,w,h,strStatus,strResizable)
{
	// Status Default : no
	if(strStatus == '')
		{
		strStatus = 'no'
		}
		
	if(strResizable == '')
		{
		strResizable = 'no'
		}
		
	window.open(strURL,'FileView','location=no,toolbar=no,menubar=no,scrollbars=' + strScroll + ',resizable=' + strResizable + ', status=' + strStatus + ',width='+ w + ',height=' + h);
}

// Script: Button Enable / Disable
function EnableBtn(){
	document.all("btnPrint").disabled = false;
}
function DisableBtn(){
	document.all("btnPrint").disabled = true;
}

// Script: Active / not Active [Input]
// IsActive(value,ActiveFiled)
function IsActive(strValue,strFieldName){
	//alert(strValue);
	if(strValue != '')
	{
	document.all(strFieldName).disabled = false;
	}
	else
	{
	document.all(strFieldName).disabled = true;
	}
}


// Script: SubmitFrm (Search Script)
function SubmitFrm()
{
		//alert('@@@@');
		//alert(document.frames("ifrmResults").frmResults.all("chkID")=="undefined"); // || document.frames("ifrmResults").frmResults.chkID.length());
	if (document.frames("ifrmResults").frmResults!=null)
	{	
		
		if (document.frames("ifrmResults").frmResults.all("chkID").length==undefined)
			{
			//only 1 checkbox exists, no LENGTH property:
				if (document.frames("ifrmResults").frmResults.all("chkID").checked)
					{
					document.frames("ifrmResults").frmResults.submit();
					return true;
					}
			}
		else
			{
				for (var i = 0; i< document.frames("ifrmResults").frmResults.all("chkID").length;i++)
				{
					//alert(frmResults.chkID[i].checked);
					if (document.frames("ifrmResults").frmResults.chkID[i].checked==true)
						{
						document.frames("ifrmResults").frmResults.submit();
						return true;
						}
				}
			}
		//no checkbox selected:
		alert('יש לסמן את המודעות שברצונך להדפיס');
		return false;
	}	
}



function SwitchMenu(obj)
	{
	try{
		
		if (document.all('sub_' + obj).style.display == 'none')
			{
			//alert('true');
			document.all('sub_' + obj).style.display = '';
			document.all('close_' + obj).style.display = '';
			document.all('note_' + obj).style.display = 'none';
			
			//document.all('img_' + obj).src = 'imgs/arrow_up.gif';
			//document.all('alt_' + obj).alt = 'סגור';

			}
		else
			{
			//alert('false');
			document.all('sub_' + obj).style.display = 'none';
			document.all('close_' + obj).style.display = 'none';
			document.all('note_' + obj).style.display = '';
			
			//document.all('img_' + obj).src = 'imgs/arrow_down.gif';
			//document.all('alt_' + obj).alt = 'הערות';
			}
		}
	catch(e){}
	}
	
	
	function ShowPic(strPIC)
{
	window.open(strPIC,'_blank','location=no,toolbar=no,menubar=no,scrollbars=Auto,resizable=yes,WIDTH=400,HEIGHT=400')
}
	
	
		
	
	
	