// FLASH DETECT FUNCTION ////|||||||||||||||||||||||||||||||
<!-- Begin
	//var MM_contentVersion = 6;
		//var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		//if (plugin) {
			//	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			//	for (var i = 0; i < words.length; ++i)
			//	{
			//	if (isNaN(parseInt(words[i])))
			//	continue;
			//	var MM_PluginVersion = words[i]; 
			//	}
		//	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
		//}
	//	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
		//   && (navigator.appVersion.indexOf("Win") != -1)) {
		//	document.write('<scr' + 'ipt language=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		//	document.write('on error resume next \n');
		//	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		//	document.write('</scr' + 'ipt\> \n');
		//}
		//if (MM_FlashCanPlay) {
		//	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"odebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="324"><param name="movie" value="../slideshow0509b.swf" /><param name=quality value=high /><embed src="../slideshow0509b.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="324"></embed></object>');
		//}else{
			document.write('<img src="http://www.yafari.net/_home/YafariHomepageImage.gif">');
		//}

//-->

var xmlHttp

function loginRep(){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	repid = document.loginform.repid.value;
	password = document.loginform.repPass.value;
	var url="../loginstatus.php";
	url=url+"?repid=" + repid;
	url=url+"&repPass=" + password;
	url=url+"&status=login";
	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("loginbox").innerHTML=xmlHttp.responseText;
	 newwindow = window.open("backoffice.php",'BackOffice','height=500,width=700,scrollbars=yes,resizable=yes,toolbar=yes,location=yes,top=50,left=50');
		if (window.focus) {newwindow.focus()}
		location.reload(true);
	} 
}

function logOutRep(){ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="../loginstatus.php";
	url=url+"?status=logout";
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedLogOut;
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
}

function stateChangedLogOut(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	 document.getElementById("loginbox").innerHTML=xmlHttp.responseText;
	} 
}


function GetXmlHttpObject(){
	var xmlHttp=null;
	try
	 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	 }
	catch (e)
	 {
	 //Internet Explorer
	 try
	  {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
}


function checkEnter(e){ //e is event object passed from function invocation
	var characterCode
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		loginRep();		
		return false;
	}else{
		return true;
	}
}