	function checkContactEmail(myForm)
	{
	// if The Hidden input value is 1 then its ok and proceed to the validation Func , if not : Do Nothing. (RobotSecure).
	if (document.FreeFrom.NewsletterEmail2.value = "1") 
	
	{
		// Check Email Validation If ok The submit The form.
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.FreeFrom.NewsletterEmail.value))
		{
			valid = true
			document.FreeFrom.submit();
		}
		// If Not then Focus on input ,clear it and return false.
		else
		{
  			alert("נא למלא כתובת אימייל תקינה");
			document.FreeFrom.NewsletterEmail.value = ""
			document.FreeFrom.NewsletterEmail.focus()
    		return false;
		}
    
	}		
	
	
	}


// This function Popup preview of the Item
	function Preview()
	{

		document.FrmUpdateItem.action="default.asp?pageid=28"
		document.FrmUpdateItem.target="_blank";
		document.FrmUpdateItem.submit();
		
	} 
function Nopreview(page)
	{

		
		document.FrmUpdateItem.action=""
		document.FrmUpdateItem.target="_self";
		
	} 
	
// This function open the upoad images page popup
	
function PhotoLoaderWin(Type,Id)
{
opener = window.open("demo1.asp?ItemType="+Type+"&ItemId="+Id,"umal","width=530,height=230,top=250,left=400,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
}


function OpenThanksPUP()
{
	window.open("SignThanksPUP.asp","umal","width=600,height=200,top=250,left=400,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
}

function OpenSendTofriend(LinkerPid,LinkerItemid)
{
	window.open("p_SendToFriend.asp?LinkerPid=" + LinkerPid + "&LinkerItemid=" + LinkerItemid ,"umal","width=600,height=200,top=250,left=400,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
}

function SendEmailToUser(Uid)
{
	window.open("SendToUser.asp?Uid="+Uid,"umal","width=600,height=330,top=250,left=400,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
}

function NotAllowed()
{
	alert("אינך מחובר/ת למערכת .")
}


function openRadio()
{
	window.open("RadioLasfm.asp","umal","width=200,height=270,top=250,left=400,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
}


function MouseOverTR(trid)
{	
	
	var objs = document.getElementById(trid);
	objs.style.background = 'f0f0f0';
}

function MouseOutTR(trid)
{	
	
	var objs = document.getElementById(trid);
	objs.style.background = 'ffffff';	

}

function AdvSearchopen(TableId)  // hide and display items
{
	var obj = document.getElementById(TableId)
	var Imgobj = document.getElementById('ArrowImg')
	
	if (obj.style.visibility == 'visible')
	{	
	obj.style.visibility = 'hidden';
	obj.style.display = 'none';
	Imgobj.src = "images/arrowdown.jpg";
	
	}
	
	else
	{
	obj.style.visibility = 'visible';
	obj.style.display = 'block';
	Imgobj.src = "images/arrowup.jpg";
	}
}


function addBookmark(title,url)
{
	if (window.sidebar)
	{ 
		window.sidebar.addPanel(title, url,""); 
	}
	else
		if( document.all )
		{
			window.external.AddFavorite( url, title);
		}
		else
			if( window.opera && window.print )
			{
				return true;
			}
}


	
function ClearField()
{
	if( FreeFrom.NewsletterEmail.value == "הזינו כתובת אימייל" )
	{
		FreeFrom.NewsletterEmail.value=""
		FreeFrom.NewsletterEmail.dir = "ltr"
					
	}
}
	
function textCounter(field, countfield, maxlimit) 
{
	if (field.value.length > maxlimit) // if too long...trim it!
	{
		field.value = field.value.substring(0, maxlimit);
	}
		// otherwise, update 'characters left' counter
	else 
	{
		countfield.value = maxlimit - field.value.length;
	}
}

	


