
function printObject(str){
	document.write(str);
}


function loginFromBox () {
	
	if (document.LoginBox.password.value==""){
		alert("נא למלא סיסמא");
		document.LoginBox.password.focus();
		confirmed="";
	}
	else{ 
		if (IsEmail(document.LoginBox.email.value)){	
			confirmed="yes";
		}else{
			alert("נא להזין כתובת אימייל");
			document.LoginBox.email.value = "";
			document.LoginBox.email.focus();
			confirmed="";
		}	
	}
	
	if (confirmed != "")	
	{
		document.getElementById('LoginBox').submit();
	}

}

function IsEmail(sText) {
	var at="@"
	var dot="."
	var lat=sText.indexOf(at)
	var lstr=sText.length
	var ldot=sText.indexOf(dot)
	if (sText=="" || sText==null){ return false }
	if (sText.indexOf(at)==-1 || sText.indexOf(at)==0 || sText.indexOf(at)==lstr){ return false }
	if (sText.indexOf(dot)==-1 || sText.indexOf(dot)==0 || sText.indexOf(dot)==lstr){ return false }
	if (sText.indexOf(at,(lat+1))!=-1){ return false }
	if (sText.substring(lat-1,lat)==dot || sText.substring(lat+1,lat+2)==dot){ return false }
	if (sText.indexOf(dot,(lat+2))==-1){ return false }
	if (sText.indexOf(" ")!=-1){ return false }
 	return true					
}

function pngFix(){
	if (document.all && document.body.filters){
		tofix = document.getElementsByTagName('img');
		for(var i=0; i<tofix.length; i++){
			var img = tofix[i];
			var imgName = img.src.toUpperCase()
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
				var imgID = (img.id) ? "id='" + img.id + "' " : "";
				var imgClass = (img.className) ? "class='" + img.className + "' " : "";
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
				var imgStyle = "display:inline-block;" + img.style.cssText ;
				if (img.align == "left") imgStyle = "float:left;" + imgStyle;
				if (img.align == "right") imgStyle = "float:right;" + imgStyle;
				var imgClick = (img.onclick != null) ? "onclick=\"" + img.onclick + "; anonymous();\"" : "";
				if (img.parentElement.href) imgStyle = "cursor:pointer;" + imgStyle;
				var strNewHTML = "<span " + imgID + imgClass + imgTitle + imgClick 
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
				img.outerHTML = strNewHTML;
				i = i-1;
			};
		};
	};
};