// JavaScript Document
function OpenGenericWin(strURL,w,h)
	{
        window.open(strURL,'_blank','menubar=no,resizable=no,scrollbars=yes,status=yes,toolbar=no,height=' + h + ',width=' + w);
	}
	

function chkAccept(Obj)
    {
        if (Obj.checked)
        {
            saveIcon.style.filter = "";    
        }
        else
        {
            saveIcon.style.filter = "gray";
        }
    }
    
    function submitForm()
    {
        if(validate() && saveIcon.style.filter != "gray")
        {
            frm.method="post" ;
            frm.action = "/ManagmentSystem/homesites_creation_step1SQL.asp";
            frm.submit();
        }
    }
    
	function checkCheckbox()
	{
		for(i=0 ; i < document.all("CategoryID").length; i++)
		{
			if (document.all("CategoryID")(i).checked)
			{
				return true;
				break;
			}
		}
		
		alert("אנא בחר קטגוריות");
		return false;
	}	
	
    function OpenSite(WebsiteID)
	{
        //window.open("../homesites/Preview.asp?WebsiteID=" + WebsiteID,"_blank");
        window.open("/homesites/preview.asp?WebsiteID=" + WebsiteID,"_blank");
	}
	
	 function WinPreview(CurrentPage,WebsiteID)
	{
		//window.open('Preview.asp?Page=' +  CurrentPage + '&WebsiteID=' + WebsiteID,'_blank');
		window.open('Site.asp?Page=' +  CurrentPage + '&WebsiteID=' + WebsiteID,'_blank');
	}
	
	
function showButton(strPath,strValue,strImgID)
	{
	if(strValue != '')
		{
		var imgPath = strPath + strValue
		document.getElementById(strImgID).src = imgPath;
		document.getElementById(strImgID).style.display = '';
		var newImg = new Image();
		newImg.src = imgPath;
		var height = newImg.height;
		var width = newImg.width;
		//alert ('The image size is '+width+'*'+height);
		document.getElementById('btnImg_SizeInfo').style.display = '';
		document.getElementById('btnImg_SizeInfo').innerHTML= "The image size is " + width + "*" + height;
		//btnImg_SizeInfo.innerText = 'The image size is '+width+'*'+height';
		}
	else
		{
		document.getElementById(strImgID).style.display = 'none';
		document.getElementById('btnImg_SizeInfo').style.display = 'none';
		}
	
	}

function winOpen(Url)
{
	window.open(Url,'Picture','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,WIDTH=526,HEIGHT=505,left=50,top=70')
}

function winOpenPassword(Url)
{
	window.open(Url,'Password','location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,WIDTH=300,HEIGHT=200,left=50,top=70')
}
