// feedback validation function //

//	^\d+\.\d+$/.test(S)   As currency , n decimals 
	
	
	//Regular expression for decimal numbers
/*	/^\d+$/                	 	All-digit
  /^[1-9]\d*$/            		All-digit, non-zero
  /^\s*[-+]\d+\s*$/       		Unbroken signed integer + spaces
  /^\d{1,5}$/             		1 to 5 digits
  /^\d+\.\d\d$/				As currency, 2 decimals
  /^\d+(\.\d{2})?$/        		As currency, 2 decimals optional
  /^[+-]?\d+(\.\d+)?(e[-+]?\d+)?$/i	Allows +3 -3.7 -3.4e+56 etc.
  not /\..*\./				Fewer than two dots
  /^\d{1,3}(,\d\d\d)*\.\d\d$/           Thou-Sep Number dot 2 decimals
  /^[A-Za-z0-9 ]{3,20}$/     text validation with space and digit
  /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/     US Phoen number validation (eg is (308)-135-7895 or 308-135-7895 or 308135-7895 or 3081357895.)
  /^[A-Za-z]\w{6,}$/;
  
    re= /^\d{1,2}\/\d{1,2}\/\d{4}$/;  date regular expression  
	
	var phone2 = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; 
	
Phone2 format
phone:
339-4248
339-42-48
339 42 48
339 4248
3394248
(095) #phone#
(095)#phone#
+7 (095) #phone#
+7 (095)#phone#
+7(095) #phone#
+7(095)#phone#

function test1(str) {
    str = alltrim(str);
    return /^[-+]?[0-9]+(\.[0-9]+)?$/.test(str);
}
function test2(str) {
    str = alltrim(str);
    return /^[-+]?\d+(\.\d+)?$/.test(str);
}
function test3(str) {
    str = alltrim(str);
    return /^[-+]?\d{3,5}(\.\d{1,3})?$/.test(str);
}

/^\d+(\.\d+)?$|^\.\d+$/ // deciamla

  */
  
  
  /* -------------------------------------Admin add Item form Validation------------------------------------*/
  
  
  
 
 
 function valid_iwantfrm(iwantfrm)
 {
	 
	 var property=iwantfrm.property.value;
	  var city_nam=iwantfrm.city_nam.value;
	   var other_city=iwantfrm.other_city.value;
	  
	 
	 var namevq=iwantfrm.namevq.value;
	 var desc=iwantfrm.desc.value;
	 var email=iwantfrm.email.value;
	  var contact=iwantfrm.contact.value;
	 var add=iwantfrm.add.value;
	 var security_code=iwantfrm.security_code.value;
	 
	// var regecp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
	 var descexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
	 var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	  var contactexp=/^\d{6,13}$/;
	 
	  if(property == "")
	  {
	 inlineMsg('property','You must select property type.');
		return false;
	  }
	   if(city_nam == "")
	  {
	 inlineMsg('city_nam','You must select city.');
		return false;
	  }
	  
	    if(city_nam == 0)
	  {
				  if(other_city == "")
			  {
			 inlineMsg('other_city','city name should not be left blank.');
				return false;
			  }
			   if(!other_city.match(descexp))
			  {
				   inlineMsg('other_city','You have Entered Invalid city.');
				return false;
			  }
			
		
		
	  }
	 
	     if(namevq == "")
	  {
	 inlineMsg('namevq','<strong></strong>You must Enter name.');
		return false;
	  }
	   if(!namevq.match(descexp))
	  {
		   inlineMsg('namevq','<strong></strong>You have Entered Invalid name.');
		return false;
	  }
	 
	     if(desc == "")
	  {
	 inlineMsg('desc','<strong></strong>You must Enter Description.');
		return false;
	  }
	  
	    if(email == "")
	  {
	 inlineMsg('email','You must Enter email.',2);
		return false;
	  }
	   if(!email.match(emailexp))
	  {
		   inlineMsg('email','You have Entered Invalid email.',2);
		return false;
	  }
	  
	  if(contact != "")
	  {
		  if(!contact.match(contactexp))
		  {
			   inlineMsg('contact','Invalid contact number');
			return false;
		  }
	  }
	
	 	   if(security_code == "")
	  {
	 inlineMsg('security_code','You must Enter captcha.',2);
		return false;
	  }
	 

	  return true;

 }
 
 //------------------------------------validation form for postadd-------------------
 
 function valid_postadd(postadd)
 {
	 var title=postadd.title.value;
 /*var page_content=postadd.page_content.value;*/
/* var country=postadd.country.value;*/
 var adcity=postadd.adcity.value;
  var other_city=postadd.other_city.value;
 
 
 var contact=postadd.contact.value;
 var add=postadd.add.value;
 var tel=postadd.tel.value;
 var email=postadd.email.value;
 var cnfemail=postadd.cnfemail.value;
 
 var pass=postadd.pass.value;

 
// var titexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
 var descexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z0-9 ])?[a-zA-Z0-9]*)*$/;
	 var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	 var contactexp=/^\d{6,13}$/;
	 var telexp=/^\(?(\d{3})\)?[-]?(\d{3})[-]?(\d{4})$/;
	var passexp= /^[a-zA-Z0-9]+(([a-zA-Z0-9])?[a-zA-Z0-9]*)*$/;
	/* var passexp=/^[A-Za-z0-9 ]\w{6,}$/;*/
	 
	  /*if(country == -1)
	  {
	 inlineMsg('country','You must Select Country.');
		return false;
	  }*/
	 if(adcity == -1)
	  {
	 inlineMsg('adcity','You must Select city.');
		return false;
	  }
	  
	  if(adcity == 0)
	  {
		  
		  if(other_city == "")
		  {
		 inlineMsg('other_city','You must Other city name.',2);
			return false;
		  }
		   if(!other_city.match(descexp))
		  {
			   inlineMsg('other_city','You have Entered Invalid Other city name.',2);
			return false;
		  }
	  }
	 
	  
	   if(title == "")
	  {
	 inlineMsg('title','You must Enter Title.',2);
		return false;
	  }
	   if(!title.match(descexp))
	  {
		   inlineMsg('title','You have Entered Invalid Title.',2);
		return false;
	  }
	  /*  if(page_content == "")
	  {
	 inlineMsg('page_content','You must Enter Description.',2);
		return false;
	  }
	   if(!page_content.match(descexp))
	  {
		   inlineMsg('page_content','You have Entered Invalid Description.',2);
		return false;
	  }*/
	 
	 
	  
	  if(contact == "")
	  {
	 inlineMsg('contact','You must Enter contact.',2);
		return false;
	  }
	   if(!contact.match(contactexp))
	  {
		   inlineMsg('contact','You have Entered Invalid contact.',2);
		return false;
	  }
	  
	    if(add == "")
	  {
	 inlineMsg('add','You must Enter address.',2);
		return false;
	  }
	   
	 
	  if(tel !== "")
	  {
		  if(!tel.match(contactexp))
	  {
		   inlineMsg('tel','You have Entered Invalid telephone.',2);
		return false;
	  }
	
	  }
	  
	   if(email == "")
	  {
	 inlineMsg('email','You must Enter email.',2);
		return false;
	  }
	   if(!email.match(emailexp))
	  {
		   inlineMsg('email','You have Entered Invalid email.',2);
		return false;
	  }
	  
	  if(cnfemail == "")
	  {
	 inlineMsg('cnfemail','You must Enter email.',2);
		return false;
	  }
	   if(!cnfemail.match(emailexp))
	  {
		   inlineMsg('cnfemail','You have Entered Invalid email.',2);
		return false;
	  }
	  
	  
	  if(pass == "")
	  {
	 inlineMsg('pass','You must Enter Password.',2);
		return false;
	  }
	   if(!pass.match(passexp))
	  {
		   inlineMsg('pass','You have Entered Invalid Password.',2);
		return false;
	  }
	 
	 
	 return true;
 }
  //------------------------------------validation form for postadd after login-------------------
 
 function valid_postadd_login(postaddlgn)
 {
	 var title=postaddlgn.title.value;
 /*var page_content=postadd.page_content.value;
  var country=postaddlgn.country.value;*/

 var adcity=postaddlgn.adcity.value;
  var other_city=postaddlgn.other_city.value;
 
	 

 
// var titexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
 var descexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z0-9 ])?[a-zA-Z0-9]*)*$/;
	 var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	 var contactexp=/^\d{6,13}$/;
	 var telexp=/^\(?(\d{3})\)?[-]?(\d{3})[-]?(\d{4})$/;
	 var passexp= /^[a-zA-Z0-9]+(([a-zA-Z0-9])?[a-zA-Z0-9]*)*$/;
	 
	 /*
	  if(country == -1)
	  {
	 inlineMsg('country','You must Select country.');
		return false;
	  }*/
	 if(adcity == -1)
	  {
	 inlineMsg('adcity','You must Select city.');
		return false;
	  }
	  
	  
	   if(adcity == 0)
	  {
		  
		  if(other_city == "")
		  {
		 inlineMsg('other_city','You must Other city name.',2);
			return false;
		  }
		   if(!other_city.match(descexp))
		  {
			   inlineMsg('other_city','You have Entered Invalid Other city name.',2);
			return false;
		  }
	  }
	  
	   if(title == "")
	  {
	 inlineMsg('title','You must Enter Title.',2);
		return false;
	  }
	   if(!title.match(descexp))
	  {
		   inlineMsg('title','You have Entered Invalid Title.',2);
		return false;
	  }
	  /*  if(page_content == "")
	  {
	 inlineMsg('page_content','You must Enter Description.',2);
		return false;
	  }
	   if(!page_content.match(descexp))
	  {
		   inlineMsg('page_content','You have Entered Invalid Description.',2);
		return false;
	  }*/
	 
	 return true;
 }
//--------------------------------------------------validation for priview-----------------------

function valid_preview_modal(preview_modal)
{
	var rep_email=preview_modal.rep_email.value;
	var prefcnt=preview_modal.prefcnt.value;
	
	var rep_message=preview_modal.rep_message.value;
	
	var contactexp=/^\d{6,13}$/;
	  var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
    //var titexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
   
	
	 
	   if(rep_email == "")
	  {
	 inlineMsg('rep_email','<strong>Error</strong>-You must Enter email.');
		return false;
	  }
	   if(!rep_email.match(emailexp))
	  {
		   inlineMsg('rep_email','<strong>Error</strong>-You have Entered Invalid email.');
		return false;
	  }
	  
	   if(prefcnt != "")
	  {
		  if(!prefcnt.match(contactexp))
	  {
		   inlineMsg('prefcnt','You have Entered Invalid contact number.');
		return false;
	  }
		  
	  }
	   if(rep_message == "")
	  {
	 inlineMsg('rep_message','You must Enter message.',2);
		return false;
	  }
	   
	 
	  return true;
	
}


function valid_preview_modal_sec(preview_modal)
{
	var rep_email=preview_modal.rep_email.value;
		var prefcnt=preview_modal.prefcnt.value;
	
	var rep_message=preview_modal.rep_message.value;
	
	
	var contactexp=/^\d{6,13}$/;
	  var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
   // var titexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
   
	
	 
	   if(rep_email == "")
	  {
	 inlineMsg('rep_email','<strong>Error</strong>-You must Enter email.');
		return false;
	  }
	   if(!rep_email.match(emailexp))
	  {
		   inlineMsg('rep_email','<strong>Error</strong>-You have Entered Invalid email.');
		return false;
	  }
	  
	   if(prefcnt == "")
	  {
	 inlineMsg('prefcnt','You must Enter contact number.');
		return false;
	  }
	   if(!prefcnt.match(contactexp))
	  {
		   inlineMsg('prefcnt','You have Entered Invalid contact number.');
		return false;
	  }
	  
	   
	   if(rep_message == "")
	  {
	 inlineMsg('rep_message','You must Enter message.',2);
		return false;
	  }
	   
	  
	 
	  return true;
	
}

//-----------------------------------login validation-----------------------------
 function valid_modal_login(modal_login)
  {
	  var fnamelgn=modal_login.fnamelgn.value;
	  var pass=modal_login.pass.value;
	  var nameexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	 var passexp= /^[a-zA-Z0-9]+(([a-zA-Z0-9])?[a-zA-Z0-9]*)*$/;
	  
	    if(fnamelgn== "")
	  {
	 inlineMsg('fnamelgn','<strong>Error</strong>You must Enter User name.',2);
		return false;
	  }
	   if(!fnamelgn.match(nameexp))
	  {
		   inlineMsg('fnamelgn','<strong>Error</strong>You have Entered Invalid user name.',2);
		return false;
	  }
	   if(pass== "")
	  {
	 inlineMsg('pass','You must Enter password.',2);
		return false;
	  }	 
	return true;  
	  
  }
  //-------------------------------------------------end of function----------------------------------------------------------
  
  //---------------------------------------------------vslidstion for gold modal window---------------------------------------
  function valid_gold_modal(gold_modal)
  {
 // var image1=gold_modal.image1.value;
  //var city=gold_modal.city.value;
  var key=gold_modal.key.value;
  var prop_type=gold_modal.prop_type.value;
  var link_title=gold_modal.link_title.value;
  var link_value=gold_modal.link_value.value;
   var isimg=/^[a-zA-Z0-9-_\.]+\.(jpeg|JPEG|jpg|JPG|gif|GIF)$/;
   	var addrexp= /^[a-zA-Z ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
   var titleexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
   
   
  /*  if(image1== "")
	  {
	 inlineMsg('image1','You must Enter Image.',2);
		return false;
	  }
	   if(!image1.match(isimg))
	  {
		   inlineMsg('image1','You have Entered Invalid Image.',2);
		return false;
	  }*/
	 /*   if(city== "")
	  {
	 inlineMsg('city','You must Enter city.',2);
		return false;
	  }
	   if(!city.match(addrexp))
	  {
		   inlineMsg('city','You have Entered Invalid city.',2);
		return false;
	  }*/
	    if(key== "")
	  {
	 inlineMsg('key','You must Enter keyword.',2);
		return false;
	  }
	   if(!key.match(addrexp))
	  {
		   inlineMsg('key','You have Entered Invalid keyword.',2);
		return false;
	  }
	    if(prop_type== "")
	  {
	 inlineMsg('prop_type','You must Enter property type.',2);
		return false;
	  }
	   if(!prop_type.match(addrexp))
	  {
		   inlineMsg('prop_type','You have Entered Invalid property type.',2);
		return false;
	  }
	   if(link_title== "")
	  {
	 inlineMsg('link_title','You must Enter Link title.',2);
		return false;
	  }
	   if(!link_title.match(addrexp))
	  {
		   inlineMsg('link_title','You have Entered Invalid Link title.',2);
		return false;
	  }
	  
	   if(link_value== "")
	  {
	 inlineMsg('link_value','You must Enter Link value.',2);
		return false;
	  }
	   if(!link_value.match(addrexp))
	  {
		   inlineMsg('link_value','You have Entered Invalid Link value.',2);
		return false;
	  }
	  
	return true;  
	  
  }
  
  
  //-----------------------------------login validation-----------------------------
 function valid_hm_search(ghmserfrm)
  {
	  var city=ghmserfrm.city.value;
	
	  
	    if(city=="")
	  {
	 inlineMsg('city','Country and City should not be left blank.');
		return false;
	  }
	  
	return true;  
	  
  }
  
  
  /*Following code for the change setting forms validatoin*/
  //--------------------------------------------------validation for priview-----------------------

function valid_cntsfrm(settingscntsfrm)
{
	var contact=settingscntsfrm.contact.value;
	var add=settingscntsfrm.add.value;
	
	var contactexp=/^\d{6,13}$/;
	  var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
    var titexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/;
   
	
	 
	   if(contact == "")
	  {
	 inlineMsg('contact','Preferred contact number should not  be left blank.');
		return false;
	  }
	   if(!contact.match(contactexp))
	  {
		   inlineMsg('contact','You have Entered Invalid Preferred contact number.');
		return false;
	  }
	   if(add == "")
	  {
	 inlineMsg('add','Address should not be left blank.');
		return false;
	  }
	   
	 
	  return true;
	
}
function valid_logofrm(settingsfrm)
{
	var img=settingsfrm.img.value;
	   if(img == "")
	  {
	 inlineMsg('contact','Logo fieldshould not  be left blank.');
		return false;
	  }
	  return true;
	
}


function valid_pass(chpassfrm)
  {
	  var oldpass=chpassfrm.oldpass.value;
	  var pass=chpassfrm.pass.value;
	   var cpass=chpassfrm.cpass.value;
	  
	  var nameexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	  var passexp= /^[a-zA-Z0-9]+(([a-zA-Z0-9])?[a-zA-Z0-9]*)*$/;
	  
	    if(oldpass== "")
	  {
	 inlineMsg('oldpass','Old password field sould not be left blank.');
		return false;
	  }
	 
	   if(pass== "")
	  {
	 inlineMsg('pass','New password should not be left blank.');
		return false;
	  }	
	  
	  if(cpass== "")
	  {
	 inlineMsg('cpass','Confirm password field should no be left blank.');
		return false;
	  }	
	return true;  
	  
  }
  /**End of the change setting form validation **/
  
  
  function valid_p_contact(p_contact)
 {
	 var p_name=p_contact.p_name.value;
	 var contact=p_contact.contact.value;
	 var p_email=p_contact.p_email.value;
	  var p_msg=p_contact.p_msg.value;
	 var captcha=p_contact.captcha.value;
	 
	 var descexp=/^[a-zA-Z0-9 ]+(([\'\,\.\- ][a-zA-Z0-9 ])?[a-zA-Z0-9]*)*$/;
	 var emailexp=/^[^ \t][_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/;
	 var contactexp=/^\d{6,12}$/;
	
	  if(p_name== "")
	  {
	 inlineMsg('p_name','You must Enter Name.');
		return false;
	  }
	   if(!p_name.match(descexp))
	  {
		   inlineMsg('p_name','You have Entered Invalid Name.');
		return false;
	  }
	  
	    if(contact== "")
	  {
	 inlineMsg('contact','You must Enter Contact No.');
		return false;
	  }
	   if(!contact.match(contactexp))
	  {
		   inlineMsg('contact','You have Entered Invalid Contact No.');
		return false;
	  }
	  
	      if(p_email== "")
	  {
	 inlineMsg('p_email','You must Enter Email.');
		return false;
	  }
	   if(!p_email.match(emailexp))
	  {
		   inlineMsg('p_email','You have Entered Invalid Email.');
		return false;
	  }
	   if(p_msg== "")
	  {
	 inlineMsg('p_msg','You must Enter Query.');
		return false;
	  }
	  
	  if(captcha== "")
	  {
	 inlineMsg('captcha','You must Enter captcha.');
		return false;
	  }
	return true;  

 }
// START OF MESSAGE SCRIPT //

var MSGTIMER = 20;
var MSGSPEED = 5;
var MSGOFFSET = 3;
var MSGHIDE = 3;

// build out the divs, set attributes and call the fade function //
function inlineMsg(target,string,autohide) {
  var msg;
  var msgcontent;
  if(!document.getElementById('msg')) {
    msg = document.createElement('div');
    msg.id = 'msg';
    msgcontent = document.createElement('div');
    msgcontent.id = 'msgcontent';
    document.body.appendChild(msg);
    msg.appendChild(msgcontent);
    msg.style.filter = 'alpha(opacity=0)';
    msg.style.opacity = 0;
    msg.alpha = 0;
  } else {
    msg = document.getElementById('msg');
    msgcontent = document.getElementById('msgcontent');
  }
  msgcontent.innerHTML = string;
  msg.style.display = 'block';
  var msgheight = msg.offsetHeight;
  var targetdiv = document.getElementById(target);
  targetdiv.focus();
  var targetheight = targetdiv.offsetHeight;
  var targetwidth = targetdiv.offsetWidth;
  var topposition = topPosition(targetdiv) - ((msgheight - targetheight) /5);
  var leftposition = leftPosition(targetdiv) + targetwidth + MSGOFFSET;
  msg.style.top = topposition + 'px';
  msg.style.left = leftposition + 'px';
  clearInterval(msg.timer);
  msg.timer = setInterval("fadeMsg(1)", MSGTIMER);
  if(!autohide) {
    autohide = MSGHIDE;  
  }
  window.setTimeout("hideMsg()", (autohide * 1000));
}

// hide the feedback alert //
function hideMsg(msg) {
  var msg = document.getElementById('msg');
  if(!msg.timer) {
    msg.timer = setInterval("fadeMsg(0)", MSGTIMER);
  }
}

// face the message box //
function fadeMsg(flag) {
  if(flag == null) {
    flag = 1;
  }
  var msg = document.getElementById('msg');
  var value;
  if(flag == 1) {
    value = msg.alpha + MSGSPEED;
  } else {
    value = msg.alpha - MSGSPEED;
  }
  msg.alpha = value;
  msg.style.opacity = (value / 100);
  msg.style.filter = 'alpha(opacity=' + value + ')';
  if(value >= 99) {
    clearInterval(msg.timer);
    msg.timer = null;
  } else if(value <= 1) {
    msg.style.display = "none";
    clearInterval(msg.timer);
  }
}

// calculate the position of the element in relation to the left of the browser //
function leftPosition(target) {
  var left = 0;
  if(target.offsetParent) {
    while(1) {
      left += target.offsetLeft;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.x) {
    left += target.x;
  }
  return left;
}

// calculate the position of the element in relation to the top of the browser window //
function topPosition(target) {
  var top = 0;
  if(target.offsetParent) {
    while(1) {
      top += target.offsetTop;
      if(!target.offsetParent) {
        break;
      }
      target = target.offsetParent;
    }
  } else if(target.y) {
    top += target.y;
  }
  return top;
}

// preload the arrow //
if(document.images) {
  arrow = new Image(7,20); 
  arrow.src = "../img/msg_arrow.gif"; 
}// feedback validation function //


