var toFocus;
function openPopUp(errHtml){
		$(".enterText").html(errHtml);
		sTop = $(window).scrollTop();
		if(sTop>0){
			centerHForPopUp = sTop;
		}
		else{
			centerHForPopUp = ($(window).height() - 154)/2;
		}
		centerForPopUp = ($(window).width() - 320)/2;
		popUpContanerW = $(window).width();
		popUpContanerH = $(document).height();

		if ( $('#alertDiv').length ){
			$('#alertDiv').css('left',centerForPopUp+'px');			
			$('#alertDiv').css('top',centerHForPopUp+'px');			
		}
		if ( $('.popUpContaner').length ){
			$('.popUpContaner').css('width',popUpContanerW+'px');			
			$('.popUpContaner').css('height',popUpContanerH+'px');			
		}
		
		$('.popUpContaner').show();
		$('#alertDiv').fadeIn('slow');
	}	
	function closePopUp(){
		$('.popUpContaner').hide();		
		$('#alertDiv').fadeOut('slow');
		$(".enterText").html("");
		toFocus.focus();
	}
	


function showFullRow(page_id)
{
	if(document.getElementById("searchResultRowFull_"+page_id).style.display=="none")
	{
		if(BrowserDetect.browser=="Explorer") 
			document.getElementById("searchResultRowFull_"+page_id).style.display = "block"
		else
			document.getElementById("searchResultRowFull_"+page_id).style.display = "table-row"
	}
	else
	{
		document.getElementById("searchResultRowFull_"+page_id).style.display = "none"
	}
}

function showManaComment(page_id)
{
	siteLang =3;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('index.asp?action=manaComments&catID='+page_id+'&siteLang='+siteLang, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=1,resizable=0,width=300,height=350,left = 540,top = 312');");
}


function changeCity(areaVal)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	else
	{
		document.getElementById("selectedCity").innerHTML="";
		var url="/contentManagment/ajax.asp";
		url=url+"?action=changeCity";
		url=url+"&areaID="+encodeURIComponent(areaVal);
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=areaChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
}
function areaChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("selectedCity").innerHTML=xmlHttp.responseText;
	} 
} 

function enlargeText(elem){
	var elemTextSize = document.getElementById(elem).style.fontSize;
	if(elemTextSize=="")
		document.getElementById(elem).style.fontSize = "18px";
	else{	
		oldSize = elemTextSize.replace("px","");
		newSize = parseFloat(oldSize)+6;
		document.getElementById(elem).style.fontSize = newSize + "px";
	}
		
	return;
}
function reduceText(elem){
	var elemTextSize = document.getElementById(elem).style.fontSize;
	if(elemTextSize=="")
		document.getElementById(elem).style.fontSize = "14px";
	else{	
		if(elemTextSize!="14px"){
			oldSize = elemTextSize.replace("px","");
			newSize = parseFloat(oldSize)-6;
			document.getElementById(elem).style.fontSize = newSize + "px";
		}
	}
		
	return;
}

function closeBanner(bannerName){
	document.getElementById(bannerName).style.display='none';
	return;
}
function doDuplicat(pageName)
{
	var duplicatTo = window.showModalDialog("/contentManagment/admin/includes/duplicat.asp","????","dialogHeight: 100px; dialogWidth: 200px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
	document.myForm.action = pageName + "?action=duplicat&newLang=" + duplicatTo;
	document.myForm.submit();
}	

function showImage(url,title,x,y)
{
	window.open(url,title,"height="+y+"px,width="+x+"px,location=no,scrollbars=yes,titlebar=no,menubars=no,toolbars=no,resizable=yes,margin=0");
}			

function MoveToPage(PageNumber,PagingPageName,filterUser)
{
	location = PagingPageName+"?iCurrentPage=" + PageNumber + filterUser;
}


function getDate(obj)
{
	var args = showModalDialog("/contentManagment/admin/includes/dPicker1.html", null ,"dialogHeight:270px; dialogwidth:230px;");
	if (args != undefined)
		obj.value= args;
	if (args == undefined)
		obj.value= "";	
}		


function getFile(objField,webSite_id)
{
	var x = showModalDialog('/contentManagment/admin/includes/browser/popups/insert_image.asp?webSite_id='+webSite_id,'', 'scrollbars:yes; width:550px; height:530px;');
	if(x != 0 && x != undefined)
	{
		objField.value = x;
	}
}	

function showBan(divName,width,height,wmode,src,bgcolor) 
{
	var d=document.getElementById(divName);
	d.innerHTML='<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0  WIDTH='+width+' HEIGHT='+height+'>'+wmode+'<PARAM NAME=movie VALUE="'+src+'"><PARAM NAME=quality VALUE=high><param name=bgcolor value="'+bgcolor+'"><EMBED src="'+src+'" quality=high WIDTH='+width+' HEIGHT='+height+' bgcolor="'+bgcolor+'" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>';
}

function showMovie(divName,width,height,src,picID) 
{
	var d=document.getElementById(divName);
	d.innerHTML='<object id="itemPlayer" style="border-left-color: #ff0000; border-bottom-color: #ff0000; border-top-style: solid; border-top-color: #ff0000; border-right-style: solid; border-left-style: solid; border-right-color: #ff0000; border-bottom-style: solid; backgroung-color: black" type="application/x-oleobject" width="'+ width +'" height="'+ height +'" standby="Loading Microsoft Windows Media Player components..."  align="absMiddle" border="0" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" bgcolor="black"><param value="'+ src +'" name="URL" /><param value="0" name="autoStart" /><param value="50" name="volume" /><param value="0" name="mute" /><param value="1" name="ShowDisplay" /><param value="1" name="ShowCaptioning" /><PARAM NAME="Enabled" VALUE="-1" /><PARAM NAME="EnableContextMenu" VALUE="0" /><PARAM name="uiMode" value="full" /></object>';
}

function showMovieAvi(divName,width,height,videoURL)
{
	var obgectInnerHTML	
	var d=document.getElementById(divName);
	objectHTML = '';
	objectHTML = objectHTML + '<OBJECT' ;
	objectHTML = objectHTML + 'id="MediaPlayer1" ';	
	objectHTML = objectHTML + 'classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ';
	objectHTML = objectHTML + 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"  ';
	objectHTML = objectHTML + 'standby="Loading Microsoft Windows® Media Player components..." ';
	objectHTML = objectHTML + 'type="application/x-oleobject" ';	
	objectHTML = objectHTML + 'WIDTH="'+width+'" ';
	objectHTML = objectHTML + 'HEIGHT="'+height+'">';
	objectHTML = objectHTML + '<PARAM NAME="fileName" VALUE="'+videoURL+'">';
	objectHTML = objectHTML + '<PARAM NAME="animationatStart" VALUE="false">';
	objectHTML = objectHTML + '<PARAM NAME="transparentatStart" VALUE="false">';
	objectHTML = objectHTML + '<PARAM NAME="autoStart" VALUE="false">';
	objectHTML = objectHTML + '<PARAM NAME="showControls" VALUE="true">';
	objectHTML = objectHTML + '<PARAM NAME="Volume" VALUE="-450">';
	objectHTML = objectHTML + '<embed src="'+videoURL+'" width="'+width+'" height="'+height+'" ';
	objectHTML = objectHTML + 'type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ';
	objectHTML = objectHTML + 'name="MediaPlayer1" ';
	objectHTML = objectHTML + 'volume="-450" ';
	objectHTML = objectHTML + 'autostart="0" ';
	objectHTML = objectHTML + 'showcontrols="1" />';
	objectHTML = objectHTML + '</OBJECT>';
	d.innerHTML=objectHTML;	
}

function showMovieFLV(divName,width,height,src,picID,flvScriptURL)
{
	var obgectInnerHTML	
	var d=document.getElementById(divName);
	objectHTML = '';
	objectHTML = objectHTML + '<OBJECT' ;
	objectHTML = objectHTML + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	objectHTML = objectHTML + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"  ';
	objectHTML = objectHTML + 'WIDTH="'+width+'" ';
	objectHTML = objectHTML + 'HEIGHT="'+height+'">';
	objectHTML = objectHTML + '<PARAM NAME=wmode VALUE=opaque>';
	objectHTML = objectHTML + '<PARAM NAME=movie VALUE="'+flvScriptURL+'">';
	objectHTML = objectHTML + '<PARAM NAME=quality VALUE=high>';
	objectHTML = objectHTML + '<PARAM NAME=flashvars VALUE="file=allowfullscreen=true&'+src+'">';
	objectHTML = objectHTML + '<embed src="'+flvScriptURL+'" width="'+width+'" height="'+height+'" ';
	objectHTML = objectHTML + 'wmode="opaque"';
	objectHTML = objectHTML + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	objectHTML = objectHTML + 'flashvars="allowfullscreen=true&file='+src+'" />';
	objectHTML = objectHTML + '</OBJECT>';
	d.innerHTML=objectHTML;	
}

function showSoundMP3(divName,width,height,src,picID,flvScriptURL)
{
	var obgectInnerHTML	
	var d=document.getElementById(divName);
	objectHTML = '';
	objectHTML = objectHTML + '<embed src="'+flvScriptURL+'" width="'+width+'" height="'+height+'" ';
	objectHTML = objectHTML + 'wmode="opaque"';
	objectHTML = objectHTML + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ';
	objectHTML = objectHTML + 'flashvars="file='+src+'&repeat=false&showdigits=true&showdownload=false"/>';
	d.innerHTML=objectHTML;	
}
function showSound(divName,width,height,src,picID,flvScriptURL)
{
	var obgectInnerHTML	
	var d=document.getElementById(divName);
	objectHTML = '';

	objectHTML = objectHTML + '<object id="itemPlayer" style="border-left-color:#ff0000; border-bottom-color:#ff0000; border-top-style:solid; border-top-color:#ff0000; border-right-style:solid; border-left-style: solid; border-right-color:#ff0000; border-bottom-style:solid; backgroung-color:black" ';
	objectHTML = objectHTML + 'type="application/x-oleobject" ';
	objectHTML = objectHTML + 'width="'+width+'"';
	objectHTML = objectHTML + 'height="'+height+'" ';
	objectHTML = objectHTML + 'standby="Loading Microsoft Windows Media Player components..." ';
	objectHTML = objectHTML + 'align="absMiddle" ';
	objectHTML = objectHTML + 'border="0" ';
	objectHTML = objectHTML + 'classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" ';
	objectHTML = objectHTML + 'bgcolor="black">';
	objectHTML = objectHTML + '	<param value="'+src+'" name="URL" />';
	objectHTML = objectHTML + '	<param value="1" name="rate" />';
	objectHTML = objectHTML + '	<param value="0" name="balance" />';
	objectHTML = objectHTML + '	<param value="0" name="currentPosition" />';
	objectHTML = objectHTML + '	<param value="" name="defaultFrame" />';
	objectHTML = objectHTML + '	<param value="1" name="playCount" />';
	objectHTML = objectHTML + '	<param value="0" name="autoStart" />';
	objectHTML = objectHTML + '	<param value="0" name="currentMarker" />';
	objectHTML = objectHTML + '	<param value="-1" name="invokeURLs" />';
	objectHTML = objectHTML + '	<param value="" name="baseURL" />';
	objectHTML = objectHTML + '	<param value="50" name="volume" />';
	objectHTML = objectHTML + '	<param value="0" name="mute" />';
	objectHTML = objectHTML + '	<param value="full" name="uiMode" />';
	objectHTML = objectHTML + '	<param value="0" name="stretchToFit" />';
	objectHTML = objectHTML + '	<param value="0" name="windowlessVideo" />';
	objectHTML = objectHTML + '	<param value="-1" name="enabled" />';
	objectHTML = objectHTML + '	<param value="-1" name="enableContextMenu" />';
	objectHTML = objectHTML + '	<param value="0" name="fullScreen" />';
	objectHTML = objectHTML + '	<param value="" name="SAMIStyle" />';
	objectHTML = objectHTML + '	<param value="" name="SAMILang" />';
	objectHTML = objectHTML + '	<param value="" name="SAMIFilename" />';
	objectHTML = objectHTML + '	<param value="" name="captioningID" />';
	objectHTML = objectHTML + '	<param value="0" name="enableErrorDialogs" />';
	objectHTML = objectHTML + '	<param value="8996" name="_cx" />';
	objectHTML = objectHTML + '	<param value="1720" name="_cy" />';
	objectHTML = objectHTML + '</object>';

	d.innerHTML=objectHTML;	
}



function addComment(page_id,webSite_id,siteLang)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('index.asp?action=addComment&comment_page_id='+page_id+'&catID='+page_id+'&siteLang='+siteLang, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=1,resizable=0,width=300,height=430,left = 540,top = 312');");
}
function sendPage(page_id,webSite_id,siteLang)
{
	day = new Date();
	id = day.getTime();	
	eval("page" + id + " = window.open('index.asp?catID='+page_id+'&siteLang='+siteLang+'&action=sendPage&send_page_id='+page_id, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=1,resizable=0,width=300,height=450,left = 540,top = 312');");	
}

function addCommentInner(page_id,webSite_id,siteLang)
{
	commentForm = document.getElementById('addCommentInner').style.display;
	if(commentForm=='none'){
		document.getElementById('addCommentInner').style.display = "block";
	}
	else{
		document.getElementById('addCommentInner').style.display = "none";
	}
}



function showComment(commentID){
	commentTable = document.getElementById('comment_table_'+commentID).style.backgroundColor;
	commentTr	 = document.getElementById('comment_tr_'+commentID).style.display;
	commentClose = document.getElementById('comment_close_'+commentID).style.display;
	commentNoText= document.getElementById('no_text_id_string').value;
	if(commentNoText.length > 0)
	{
		commentNoText = "|"+commentNoText;	
		if (commentNoText.indexOf("|"+commentID+"|")>0)
		{
		}
		else
		{
			if(commentTr=='none'){
				document.getElementById('comment_tr_'+commentID).style.display = "block";
				document.getElementById('comment_close_'+commentID).style.display = "block";
				//icoArrowNew = icoArrow.replace("ico_arrow.jpg","ico_arrow_down.jpg");		
			}
			else{
				document.getElementById('comment_tr_'+commentID).style.display = "none";
				document.getElementById('comment_close_'+commentID).style.display = "none";
				//icoArrowNew = icoArrow.replace("ico_arrow_down.jpg","ico_arrow.jpg");		
			}
			//alert(commentNoText);
		}
	}
	else
	{
		if(commentTr=='none'){
			document.getElementById('comment_tr_'+commentID).style.display = "block";
			document.getElementById('comment_close_'+commentID).style.display = "block";
			//icoArrowNew = icoArrow.replace("ico_arrow.jpg","ico_arrow_down.jpg");		
		}
		else{
			document.getElementById('comment_tr_'+commentID).style.display = "none";
			document.getElementById('comment_close_'+commentID).style.display = "none";
			//icoArrowNew = icoArrow.replace("ico_arrow_down.jpg","ico_arrow.jpg");		
		}
	}
}
function openComments(numOfComments){
	for (i=1; i<=numOfComments; i++)	
	{
		commentTable = document.getElementById('comment_table_'+i).style.backgroundColor;
		commentTr	 = document.getElementById('comment_tr_'+i).style.display;
		document.getElementById('comment_table_'+i).style.backgroundColor = "#DFE2E1";
		document.getElementById('comment_tr_'+i).style.display = "block";
	}
}
function closeComments(numOfComments){
	for (i=1; i<=numOfComments; i++)	
	{
		commentTable = document.getElementById('comment_table_'+i).style.backgroundColor;
		commentTr	 = document.getElementById('comment_tr_'+i).style.display;
		document.getElementById('comment_table_'+i).style.backgroundColor = "#FFFFFF";
		document.getElementById('comment_tr_'+i).style.display = "none";
	}
}

function printpage() {
	window.print();  
}

function changeLang(pageName)
{
	document.myForm.action = pageName;
	document.myForm.submit();	
}	



function changeCountry(countryID)
{
	document.getElementById("city_select").innerHTML=""
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="/contentManagment/admin/includes/ajax.asp"
	url=url+"?action=changeCountry"
	url=url+"&countryID="+countryID.value
	url=url+"&filterOptions=1"
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=countryChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 
	
function countryChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("city_select").innerHTML=xmlHttp.responseText;
	} 
} 
function showHint(str)
{
	if (str.length==0)
	{ 
		document.getElementById("txtHint").innerHTML=""
		return
	}
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="/contentManagment/admin/includes/ajax.asp"
	url=url+"?action=checkPassportNew"
	url=url+"&passportNew="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 
	
function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
	} 
	} 


function getColor(objField)
{
	var oldcolor = objField.value;
	var newcolor = showModalDialog("/contentManagment/admin/includes/htmlarea/popups/select_color.html", oldcolor, "resizable: no; help: no; status: no; scroll: no;");
	objField.value = newcolor;	
	objField.style.backgroundColor = newcolor;	
		
}			


function getFieldFromTable(tableName,fieldName,objField)
{
	return window.open("/contentManagment/admin/tables/tablesIndex.asp?tableName="+tableName+"&fieldName="+fieldName+"&objField="+objField,"","scrollbars=yes,width=300,height=350");		
}
	
function closeFilterDiv()
{
	document.getElementById("filterDiv").innerHTML=""
}

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 	

function saveAndmove(passportNum,rowTable,att)
{
	document.all.myForm.action = "?action=updateNext&selectedRow=" + passportNum + "&rowTable=" + rowTable + "&att=" + att
	document.all.myForm.submit()
}
function saveAndmoveBack(passportNum,rowTable,att)
{
	document.all.myForm.action = "?action=updatePrev&selectedRow=" + passportNum + "&rowTable=" + rowTable + "&att=" + att
	document.all.myForm.submit()
}

function setChecked()
{
	var isCheaced = "";
	for (i=0; i<document.myForm.elements.length; i++)	
	{
		if (document.myForm.elements[i].type=="checkbox")
		{
			if (document.myForm.elements[i].checked == true)
			{
				isCheaced = isCheaced + "1"
			}			
		}
	}

	
	for (i=0; i<document.myForm.elements.length; i++)	
	{
		if (document.myForm.elements[i].type=="checkbox")
		{
			if (isCheaced == "")
			{
				document.myForm.elements[i].checked = true
			}
			else
			{
				document.myForm.elements[i].checked = false				
			}	
			
		}	
	}	
}

















var myPASSPORT = "";
function showGroups(PASSPORT)
{
	myPASSPORT = PASSPORT;
	document.getElementById("group_for_organizer_"+PASSPORT).innerHTML="";
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var url="/contentManagment/admin/includes/ajax.asp";
	url=url+"?action=paymentShowGroup";
	url=url+"&PASSPORT="+PASSPORT;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=groupChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
function hideGroups(PASSPORT)
{
	myPASSPORT = PASSPORT;
	document.getElementById("group_for_organizer_"+PASSPORT).innerHTML="";
} 
	
function groupChanged()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("group_for_organizer_"+myPASSPORT).innerHTML=xmlHttp.responseText;
	} 
} 





var myGroup_id = "";
function showStudents(group_id)
{
	myGroup_id = group_id;
	document.getElementById("students_for_group_"+group_id).innerHTML="";
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var url="/contentManagment/admin/includes/ajax.asp";
	url=url+"?action=paymentShowStudents";
	url=url+"&group_id="+group_id;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=studentChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
function hideStudents(group_id)
{
	myGroup_id = group_id;
	document.getElementById("students_for_group_"+group_id).innerHTML="";
} 
	
function studentChanged()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("students_for_group_"+myGroup_id).innerHTML=xmlHttp.responseText;
	} 
} 








var mySPASSPORT = "";
function showLessons(PASSPORT)
{
	mySPASSPORT = PASSPORT;
	document.getElementById("lessons_for_student_"+PASSPORT).innerHTML="";
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var url="/contentManagment/admin/includes/ajax.asp";
	url=url+"?action=paymentShowLessons";
	url=url+"&student_id="+PASSPORT;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=lessonChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
function hideLessons(PASSPORT)
{
	mySPASSPORT = PASSPORT;
	document.getElementById("lessons_for_student_"+PASSPORT).innerHTML="";
} 
	
function lessonChanged()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("lessons_for_student_"+mySPASSPORT).innerHTML=xmlHttp.responseText;
	} 
} 







function showTab(tabToShow,tabNum)
{
	for (i=1; i<=tabNum; i++)	
	{
		if(i!=tabToShow)
		{
			if(document.getElementById(i+'_tab_head') != null)
			{
				document.getElementById(i+'_tab').style.display='none';
				document.getElementById(i+'_tab_head').className = 'tab_off_td';
			}
		}
		else
		{
			document.getElementById(i+'_tab').style.display='block';									
			document.getElementById(i+'_tab_head').className = 'tab_on_td';										
		}	
	}	
}





function startclock()
{
	var thetime=new Date();
	var nhours=thetime.getHours();
	var nmins=thetime.getMinutes();
	var nsecn=thetime.getSeconds();
	var nday=thetime.getDay();
	var nmonth=thetime.getMonth();
	var ntoday=thetime.getDate();
	var nyear=thetime.getYear();
	var AorP=" ";

	if (nhours>=12)
		AorP="P.M.";
	else
		AorP="A.M.";

	if (nhours>=13)
		nhours-=12;
	
	if (nhours==0)
	   nhours=12;
	
	if (nsecn<10)
	 nsecn="0"+nsecn;
	
	if (nmins<10)
	 nmins="0"+nmins;
	
	if (nday==0)
	  nday="Sunday";
	if (nday==1)
	  nday="Monday";
	if (nday==2)
	  nday="Tuesday";
	if (nday==3)
	  nday="Wednesday";
	if (nday==4)
	  nday="Thursday";
	if (nday==5)
	  nday="Friday";
	if (nday==6)
	  nday="Saturday";

	nmonth+=1;

	if (nyear<=99)
	  nyear= "19"+nyear;
	
	if ((nyear>99) && (nyear<2000))
	 nyear+=1900;

document.getElementById('corentTimeDIV').innerHTML = nhours+":"+nmins+":"+nsecn+" "+ntoday+"/"+nmonth+"/"+nyear;

setTimeout('startclock()',1000);

} 

// return date formatted as dd/mm/yyyy
function selectDate_formatDate(dyear,dmonth,dday) 
{
	min_year = 1900;
	if (dyear<min_year) {
	  dyear = min_year;
	}
	y_mod4 = dyear % 4;
	if (dmonth<1) dmonth = 1;
	if (dmonth>12) dmonth = 12;
	if (dmonth==2) {
	  num_days = (y_mod4==0)?29:28;
	} else if(dmonth % 2) {
	  num_days = 31;
	} else {
	  num_days = 30;
	}
	if (dday<1) dday =1;
	if (dday>num_days) dday = num_days;
	res = (dday<10)?("0"+dday+"/"):(dday+"/");
	res += (dmonth<10)?("0"+dmonth+"/"):(dmonth+"/");
	res += dyear;
	return res;
	}
			function setSelectDate(attID)
			{
				inputDate = document.getElementById(attID).value;
				inputDate_day = document.getElementById('selectDateDay_'+attID).value;
				inputDate_month = document.getElementById('selectDateMonth_'+attID).value;
				inputDate_year = document.getElementById('selectDateYear_'+attID).value;
	
	dyear = parseInt(inputDate_year);
	dmonth = parseInt(inputDate_month);
	dday = parseInt(inputDate_day);
	
	f_date = selectDate_formatDate(dyear,dmonth,dday);
	document.getElementById(attID).value = f_date;
	//alert(f_date);
			}
			
			
			
			
			







/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

// UDMv4.5 //
/***************************************************************/
var um={'menuClasses':[],'itemClasses':[],'menuCode':[]};
/***************************************************************\

  ULTIMATE DROP DOWN MENU Version 4.5 by Brothercake
  http://www.udm4.com/

  This script may not be used or distributed without license

\***************************************************************/


/***************************************************************\
 * CORE CONFIGURATION
\***************************************************************/


//path to images folder
um.baseSRC = "/udm-resources/";


//initialization trigger element ["id"];
um.trigger = "contact";


//navbar orientation
um.orientation = [
	"expanding",	// alignment ["vertical"|"horizontal"|"popup"|"expanding"]
	"left",		// h align ["left"|"right"|"rtl"]
	"top",		// v align ["top"|"bottom"]
	"absolute",	// positioning ["relative"|"absolute"|"fixed"|"allfixed"]
	"8px",	// x position ["em"|"ex"|"px"|"0"]
	"8px",	// y position ["em"|"ex"|"px"|"0"]
	"1000",		// z order ["0" to "10000"] (menu takes 20000 headroom)
	];


//navbar list output
um.list = [
	"flexible",	// horizontal overflow ["rigid"|"flexible"]
	"yes",		// -SPARE-
	"no", 		// -SPARE-
	];


//menu behaviors
um.behaviors = [
	"0",		// open timer ["milliseconds"|"0"]
	"never",	// close timer ["milliseconds"|"never"|"0"]
	"yes",		// reposition menus to stay inside the viewport ["yes"|"no"]
	"none",	// manage windowed controls for win/ie ["default","hide","iframe","none"]
	];


//reset behaviors
um.reset = [
	"no",		// reset from document mouse click ["yes"|"no"]
	"no",		// reset from window resize ["yes"|"no"]
	"no",		// reset from text resize ["yes"|"no"]
	"no",		// reset after following link ["yes"|"no"]
	];


//horizontal continuation strip
um.hstrip = [
	"none",		// background ["color"|"#hex"|"rgb()"|"image.gif"|"none"]
	"yes",		// copy item margin-right to margin-bottom ["yes"|"no"]
	];


/***************************************************************\
 * MODULE SETTINGS
\***************************************************************/


//keyboard navigation
um.keys = [
	"38",		// up ["n"] ("38" = up arrow key)
	"39",		// right ["n"] ("39" = right arrow key)
	"40",		// down ["n"] ("40" = down arrow key)
	"37",		// left ["n"] ("37" = left arrow key)
	"123",		// hotkey ["n"] ("123" = F12)
	"none",		// hotkey modifier ["none"|"shiftKey"|"ctrlKey"|"altKey"|"metaKey"]
	"27",		// escape ["n"|"none"] ("27" = escape key)
	"document.getElementsByTagName('a')[4]", // exit focus ["js-expression"]
	];


/***************************************************************\
 * NAVBAR DEFAULT STYLES
\***************************************************************/


//styles which apply to the navbar
um.navbar = [
	"0",		// nav to menu x-offset (+-)["n" pixels]
	"0",		// nav to menu y-offset (+-)["n" pixels]
	"128px",	// width ["em"|"ex"|"px"] (vertical navbar only - horizontal navbar items have "auto" width) ("%" doesn't work right)
	];


//styles which apply to each navbar item
um.items = [
	"1",		// margin between items ["n" pixels]
	"1",		// border size ["n" pixels] (single value only)
	"collapse",	// border collapse ["collapse"|"separate"] (only applies when margin = "0")
	"#ead4a4 #edbb85 #edbb85 #ead4a4",// border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"#ead4a4 #ead4a4 #fae4b4 #fae4b4",// hover/focus border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// hover/focus border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"#ead4a4 #edbb85 #edbb85 #ead4a4",// visited border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid dashed solid solid",// visited border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"9",		// left/right padding ["n" pixels] (single value only)
	"5",		// top/bottom padding ["n" pixels] (single value only)
	"orange-yellow-gradient.jpg",// background ["color"|"#hex"|"rgb()"|"image.gif"]
	"orange-cream-gradient.jpg",// hover/focus background ["color"|"#hex"|"rgb()"|"image.gif"]
	"orange-yellow-gradient.jpg",// visited background ["color"|"#hex"|"rgb()"|"image.gif"]
	"75%",		// font size ["em"|"ex"|"%"|"px"|"pt"|"absolute-size"|"relative-size"]
	"tahoma,sans-serif",// font family ["font1,font2,font3"] (always end with a generic family name)
	"bold",		// font weight ["normal"|"bold"|"bolder"|"lighter|"100" to "900"]
	"none",		// text decoration ["none"|"underline"|"overline"|"line-through"]
	"left",		// text-align ["left"|"right"|"center"]
	"#008000",	// color ["color"|"#hex"|"rgb()"]
	"#b05010",	// hover/focus color ["color"|"#hex"|"rgb()"]
	"#008000",	// visited color ["color"|"#hex"|"rgb()"]
	"normal",	// font-style ["normal"|"italic"|"oblique"]
	"normal",	// hover/focus font-style ["normal"|"italic"|"oblique"]
	"normal",	// visited font-style ["normal"|"italic"|"oblique"]
	"background-color:#ffc;letter-spacing:1px !important;",// additional link CSS (careful!)
	"background-color:#ffe;",// additional hover/focus CSS (careful!)
	"background-color:#ffc;",// additional visited CSS (careful!)
	"down-green.gif",// menu indicator character/image ["text"|"image.gif"|"none"]
	"down-red.gif",// menu indicator rollover image ["image.gif"|"none"] (only when using image arrows)
	"7",		// clipping width of indicator image ["n" pixels] (only when using image arrows)
	"..",		// alt text of indicator image ["text"] (only when using image arrows)
	];


/***************************************************************\
 * MENU DEFAULT STYLES
\***************************************************************/


//styles which apply to each menu
um.menus = [
	"0",		// menu to menu x-offset (+-)["n" pixels]
	"0",	// menu to menu y-offset (+-)["n" pixels]
	"1",		// border size ["n" pixels] (single value only)
	"#ead4a4",// border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"119px",	// width ["em"|"ex"|"px"]
	"3",		// padding ["n" pixels] (single value only)
	"#f8fbd0",	// background ["color"|"#hex"|"rgb()"|"image.gif"]
	"",		// additional menu CSS (careful!) (you can use a transition here but *not* a static filter)
	"none",// shadow background ["color"|"#hex"|"rgb()"|"image.gif"|"none"]
	"0",		// shadow offset (+-)["em"|"ex"|"px"|"%"|"0"]
	"",// additional shadow layer CSS (if you use a Microsoft.Shadow filter here then Win/IE5.5+ will do that *instead* of default shadow)
	];


//styles which apply to each menu item
um.menuItems = [
	"0",		// margin around items ["n" pixels] (single value only; margins are like table cellspacing)
	"0",		// border size ["n" pixels] (single value only)
	"separate",	// border collapse ["collapse"|"separate"] (only applies when margin = "0")
	"",	// border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"",		// hover/focus border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// hover/focus border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"",	// visited border colors ["color"|"#hex"|"rgb()"] (single, double or four values)
	"solid",	// visited border styles ["solid"|"double"|"dotted"|"dashed"|"groove"|"ridge"|"inset"|"outset"] (single, double or four values; be careful with using "none")
	"5",		// left/right padding ["n" pixels] (single value only)
	"2",		// top/bottom padding ["n" pixels] (single value only)
	"transparent",	// background ["color"|"#hex"|"rgb()"|"image.gif"]
	"#fec",	// hover/focus background ["color"|"#hex"|"rgb()"|"image.gif"]
	"transparent",	// visited background ["color"|"#hex"|"rgb()"|"image.gif"]
	"70%",		// font size ["em"|"ex"|"%"|"px"|"pt"|"absolute-size"|"relative-size"]
	"'trebuchet sans ms',sans-serif",// font family ["font1,font2,font3"] (always end with a generic family name)
	"normal",	// font weight ["normal"|"bold"|"bolder"|"lighter|"100" to "900"]
	"none",		// text decoration ["none"|"underline"|"overline"|"line-through"]
	"left",		// text-align ["left"|"right"|"center"]
	"#060",		// color ["color"|"#hex"|"rgb()"]
	"#000",		// hover/focus color ["color"|"#hex"|"rgb()"]
	"#060",		// visited color ["color"|"#hex"|"rgb()"]
	"normal",	// font-style ["normal"|"italic"|"oblique"]
	"normal",	// hover/focus font-style ["normal"|"italic"|"oblique"]
	"normal",	// visited font-style ["normal"|"italic"|"oblique"]
	"letter-spacing:0 !important;",		// additional link CSS (careful!)
	"",		// additional hover/focus CSS (careful!)
	"",		// additional visited CSS (careful!)
	"down-tinygreen.gif",// submenu indicator character/image ["text"|"image.gif"|"none"]
	"down-tinyblack.gif",// submenu indicator rollover image ["image.gif"|"none"] (only when using image arrows)
	"7",		// clipping width of indicator image ["n" pixels] (only when using image arrows)
	"..",		// alt text of indicator image ["text"] (only when using image arrows)
	];


/***************************************************************\
 * MENU CLASSES
\***************************************************************/




/***************************************************************\
 * DYNAMIC MENUS
\***************************************************************/





/***************************************************************\
\***************************************************************/


/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////





// check wat to insert only english
  var input_fix_tick_last_val = "";
  var input_fix_lang = "en";

  // to select the filter, uncomment the appropriate line:
  var input_fix_regex = new Array();
  regex_common_allowed = "0-9\\-\\s,.!*@_";
  input_fix_regex["en"] = new RegExp("[^"+regex_common_allowed+"a-zA-Z]","g");
  input_fix_regex["he"] = new RegExp("[^"+regex_common_allowed+"?-?]","g");
  input_fix_regex["ru"] = new RegExp("[^"+regex_common_allowed+"?-??-?]","g");
  
  var input_fix_arr = Array();
  
  function input_fix_tick() {
    for (e_id in input_fix_arr) {
      edata = input_fix_arr[e_id];
      elm = edata["elm"];
      my_regex = edata["regex"];
      str = elm.value;
      if (str!=input_fix_tick_last_val) {
        str_fix = str.replace(my_regex,'');
        if (str_fix!=str) {
          input_fix_tick_last_val = str_fix;
          elm.value = str_fix;
        }
      }
    }
    setTimeout("input_fix_tick()",100);
  }
  
  function inpux_fix_keypress(event) {
    if (window.event) {
      evt = window.event;
    } else {
      evt = event;
    }
    if (evt.keyCode) {
      code = evt.keyCode;
    } else if (evt.charCode) {
      code = evt.charCode;
    } else {
      return true;
    }
    if ((code<32) || (code==37) || (code==39)) return true;
    str = String.fromCharCode(code);
    if (evt.srcElement) {
      elm = evt.srcElement;
    } else if (evt.target) {
      elm = evt.target;
    } else {
      return true;
    }
    edata = input_fix_arr[elm.id];
    if (!edata) return true;
    my_regex = edata["regex"];
    if (str.search(my_regex)==-1) {
      return true;
    } else {
      return false;
    }
  }
  
  function input_fix_register_element(elm_id,elm_lang) {
    elm = document.getElementById(elm_id);
    if (!elm) {
      alert('input_fix: bad element id!'); return;
    }
    my_regex = input_fix_regex[elm_lang];
    if (!my_regex) {
      alert('input_fix: bad language code!'); return;
    }
    edata = new Array();
    edata["elm"] = elm;
    edata["regex"] = my_regex;
    input_fix_arr[elm_id] = edata;
    elm.onkeypress = inpux_fix_keypress;
  }






  var dsearch_clicked = 0;
  function dsearch_activate(elem) {
    if (dsearch_clicked) return;
    elem.value = '';
    elem.style.color = '#000000';
    dsearch_clicked = 1;
  }




function startclock()
{
	var thetime=new Date();
	var nhours=thetime.getHours();
	var nmins=thetime.getMinutes();
	var nsecn=thetime.getSeconds();
	var nday=thetime.getDay();
	var nmonth=thetime.getMonth();
	var ntoday=thetime.getDate();
	var nyear=thetime.getYear();
	var AorP=" ";

	if (nhours>=12)
		AorP="P.M.";
	else
		AorP="A.M.";

	if (nhours>=13)
		nhours-=12;
	
	if (nhours==0)
	   nhours=12;
	
	if (nsecn<10)
	 nsecn="0"+nsecn;
	
	if (nmins<10)
	 nmins="0"+nmins;
	
	if (nday==0)
	  nday="Sunday";
	if (nday==1)
	  nday="Monday";
	if (nday==2)
	  nday="Tuesday";
	if (nday==3)
	  nday="Wednesday";
	if (nday==4)
	  nday="Thursday";
	if (nday==5)
	  nday="Friday";
	if (nday==6)
	  nday="Saturday";

	nmonth+=1;

	if (nyear<=99)
	  nyear= "19"+nyear;
	
	if ((nyear>99) && (nyear<2000))
	 nyear+=1900;

document.getElementById('corentTimeDIV').innerHTML = ntoday+"/"+nmonth+"/"+nyear;

setTimeout('startclock()',1000);

} 

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


/*
##########################################
#######  menu  ##########
##########################################
*/
/*navHover = function() {
	var lis = document.getElementById("navmenu-v").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);*/


<!-- Changes:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

/* 1.1.2: Fixed a bug where trailing . in e-mail address was passing
            (the bug is actually in the weak regexp engine of the browser; I
            simplified the regexps to make it work).
   1.1.1: Removed restriction that countries must be preceded by a domain,
            so abc@host.uk is now legal.  However, there's still the 
            restriction that an address must end in a two or three letter
            word.
     1.1: Rewrote most of the function to conform more closely to RFC 822.
     1.0: Original  */

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function emailCheck (emailStr) {
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	//alert("????? ??????? - ???? ?????!")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    //alert("The username doesn't seem to be valid.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        //alert("Destination IP address is invalid!")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	//alert("The domain name doesn't seem to be valid.")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   //alert("The address must end in a three-letter domain, or two letter country.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="This address is missing a hostname!"
   //alert(errStr)
   return false
}

// If we've gotten this far, everything's valid!
return true;
}
//  End -->

