	// working
function mouseX(evt) {
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX)
	   return evt.clientX + (document.documentElement.scrollLeft ?
	   document.documentElement.scrollLeft :
	   document.body.scrollLeft);
	else return null;
}
//working
function mouseY(evt) {
	
if (evt.pageY) return evt.pageY;
	else if (evt.clientY)
	   return evt.clientY + (document.documentElement.scrollTop ?
	   document.documentElement.scrollTop :
	   document.body.scrollTop);
	else return null;
}
// Working 
function displayLoginDiv(divId,rightInd,backUrl,auctionID,itemId,e){
		
	if(document.getElementById('pageName') && document.getElementById('pageName').value=='calendar'){
			backUrl='calendar';
	}
	var viewType=document.getElementById("viewType").value;
	document.getElementById("view").value=viewType;
	document.getElementById("loginBox").style.display="";
	
	var agt=navigator.userAgent.toLowerCase();
	 var is_major = parseInt(navigator.appVersion);
	 var is_minor = parseFloat(navigator.appVersion);
	var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
	 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
	 && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	 var is_nav4 = (is_nav && (is_major == 4));
	 var is_nav6 = (is_nav && (is_major == 5));
	 var is_nav6up = (is_nav && (is_major >= 5));
	 
	 var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	if(!is_ie){
		 x=mouseX(e);
		 y=mouseY(e);
		 if(viewType!=2){
			document.getElementById("loginBox").style.left = x - 400 +'px';
			document.getElementById("loginBox").style.top = y  +'px';
		 }else{
			 document.getElementById("loginBox").style.left = x + 20 +'px';
			 document.getElementById("loginBox").style.top = y  +'px';
		 }
	}else{
 		 x=mouseX(e);
		 y=mouseY(e);
		 if(viewType!=2){
			document.getElementById("loginBox").style.left = x - 400 +'px';
			 document.getElementById("loginBox").style.top = y  +'px';
		 }else{
			 document.getElementById("loginBox").style.left = x + 20 +'px';
			 document.getElementById("loginBox").style.top = y  +'px';
		 }
	 }
	/*
	var divIdOld=document.getElementById('div_Hid').value;
	if(divIdOld){
		document.getElementById(divIdOld).innerHTML='';
	}*/
	if(document.getElementById('div_Hid')){
		var divIdOld=document.getElementById('div_Hid').value;
		if(divIdOld){
			document.getElementById(divIdOld).innerHTML='';
		}
		document.getElementById('div_Hid').value=divId;
	}
	
	document.getElementById(divId).style.right=rightInd+'px';
	//var logText=document.getElementById('loginBox').innerHTML;
	//document.getElementById(divId).innerHTML=logText;
	
	document.getElementById('backUrl').value=backUrl;
	document.getElementById('auctionIdBack').value=auctionID;
	document.getElementById('itemIdBack').value=itemId;
}
// working
function closeLoginBox(){
		
		
	document.getElementById('loginBox').style.display="none";
	//var divIdOld=document.getElementById('div_Hid').value;
	//if(divIdOld){
	//	document.getElementById(divIdOld).innerHTML='';
	//}	
	//document.getElementById('div_Hid').value='';
}
  function IsEmailAddressValid(objEmail,strErrorMesg) {
	 
      var blnIsEmailAddress = true;	
    var blnObjectPrm=false;
    var i=0;	
    var strEmail='';
    var objThis;

    if (isIE)
      blnObjectPrm = (typeof(objEmail)=='object'?true:false) ; 

    if (blnObjectPrm) {
      objThis = objEmail;
      strEmail=objEmail.value;
    }
    else {
      if (objEmail.substring(0,8)=='document') {
        objThis =eval(objEmail); 
        strEmail=objThis.value;
        blnObjectPrm = true; 
      }
      else
        strEmail=objEmail;
    }

    blnIsEmailAddress=(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);
    if (!blnIsEmailAddress && strErrorMesg!='') {
      //alert(strErrorMesg);
      if (blnObjectPrm) {
        //objThis.select();
        objThis.focus();		
      }
    }

    return blnIsEmailAddress;
  }
function saveListings(propId,auctionID)
{ 

	//var auctionID=document.getElementById('auctionID').value;
	var propertyId=propId;
	var usrId=document.getElementById('userId').value;
	document.getElementById('itemId').value='';
	document.getElementById('itemId').value=propId;
	
	var strSubmit = "action=saveListings&auctionID="+auctionID+"&propertyId="+propertyId+"&userId="+usrId;	
	var strURL = "getAjax.php";
	var strResultFunc = "show_message";
	xmlhttpPost(strURL, strSubmit, strResultFunc);
}
function show_message(result)
{
	
	var id=document.getElementById('itemId').value;
	var elemnt='saveButt_'+id;
		if(document.getElementById(elemnt)){
		document.getElementById(elemnt).innerHTML='';
		document.getElementById(elemnt).innerHTML=result;
	}
}
// working

