var ns6 = (!document.all && document.getElementById);

function EmptyFields(whichField){
	if  (document.getElementById(whichField).style.color!='darkblue')
	{
		document.getElementById(whichField).value = '';
		document.getElementById(whichField).style.color = 'darkblue';
		document.getElementById(whichField).style.fontWeight = 'bold'
	}
}


function go(ID,Decoup){
	top.location.href = "prend" + Decoup + ".asp?ID_sefer=" + ID ;
}


function textCounter(whichField,  maxLimit) 
{   
//  Check the length of an input box.  If too long...trim it!
		
	var field = document.getElementById(whichField)
	if (field.value.length > maxLimit-1)
	{
		field.value = field.value.substring(0, maxLimit-1);
	}
}


function change(ID){

	var casejour = document.getElementById(ID).style.backgroundColor;

	if (casejour == '#c0e0ff')
	{
		document.getElementById(ID).style.backgroundColor = 'white';
	}else {
		document.getElementById(ID).style.backgroundColor = '#c0e0ff';
	}

}

function checkEmail(emailAddr)
{
   	var strudel  = emailAddr.indexOf("@")
   	var comma   = emailAddr.indexOf(",")
   	var space  = emailAddr.indexOf(" ")
   	var period  = emailAddr.lastIndexOf(".") + 1
   	var emailLen = emailAddr.length
	 			 
   if (emailAddr == '') {return;}

   if (    (strudel > 0) 
   	     && (comma == -1) 
   	     && (space == -1) 
   	     && (emailLen - period >= 2) 
   	     && (emailLen - period <= 4)
   	     && (emailLen!=0)  )
   	{
		return true;
		
   	}
   	else
   	{  
		return false;
		
   	}			
}

function setCenterHeight()
{
		if (top.frames["iframeCenter"].document.body.scrollHeight > 300)
		{
			top.document.getElementById('iframeCenter').height = top.frames["iframeCenter"].document.body.scrollHeight;
		}
		else
		{
			top.document.getElementById('iframeCenter').height = 350;
		}
}

	