function omit(str)

{

	if(str=="username")

	{

		document.getElementById('username').value="";

	}

    else if(str=="")

   {

   document.getElementById('username').value="username";

   }

}

function omit_keyword(str)

{

	if(str=="Enter part name and select...")

	{

		//document.getElementById('keyword1').className="linklists";

		 document.getElementById('keyword1').className="textfield_src";

		document.getElementById('keyword1').value="";

		

	}

    else if(str=="")

   {

	    document.getElementById('keyword1').className="textfield_src";

   document.getElementById('keyword1').value="Enter part name and select...";

   

   }

  

}

function omit_keyword1(str)

{

	if(str=="Enter part name and select...")

	{

		document.getElementById('keyword1').className="textfield_src";

		document.getElementById('keyword1').value="";

	

		}

    else if(str=="")

   {

   document.getElementById('keyword1').value="Enter part name and select...";

   //document.getElementById('keyword1').className="linklists";

   //document.getElementById('keyword1').style="color:#fedrfedr;font-size:12px;";

   }

  

}

/*function menu_colapse(id1,id2)

{

	var id11=trim(id2);

	alert(id11);

if(document.getElementById(trim(id1)).className =="sortitem_col")

{



document.getElementById(trim(id1)).className ="sortitem";

//document.getElementById(id2).style.display="none";

$j("#"id11).slideUp("slow");

}

else

{

document.getElementById(trim(id1)).className ="sortitem_col";

//document.getElementById(id2).style.display="";

$j("#"id11).slideDown("slow");

}

function ltrim(str) { 

for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);

return str.substring(k, str.length);

}

function rtrim(str) {

for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;

return str.substring(0,j+1);

}

function trim(str) 

{



return ltrim(rtrim(str));

}

function isWhitespace(charToCheck) { 

var whitespaceChars = " \t\n\r\f";

return (whitespaceChars.indexOf(charToCheck) != -1);

}

}*/

function username_focus(str)

{

   if(str=="username")

   {

   document.getElementById('username').value="";

   }

   else if(str=="")

   {

   document.getElementById('username').value="username";

   }

}

function omitpassword(str)

{

	if(str=="password")

	{

		document.getElementById('password').value="";

	}

    else if(str=="")

   {

   document.getElementById('password').value="password";

   }

}

function password_focus(str)

{

   if(str=="password")

   {

   document.getElementById('password').value="";

   }

   else if(str=="")

   {

   document.getElementById('password').value="password";

   }

}

function imgover(str)



			{



				return overlib(' Translate this Page into '+str, CAPTION, '&nbsp;HolidayHomeAds Help', FGCOLOR, '#FFFFCC', BORDER, 0, BGCOLOR, '#528df5', TEXTCOLOR, '#5A595A', RIGHT);



				return false;



			}



		



function openhtml(arg)



{



	var html_url='http://www.holidayhomeads.com/viewdetails/id/'+arg+'.html';



	 window.open (html_url,"mywindow"+arg,"location=1,status=1,resizable=1,scrollbars=1,width=600,height=500,left=120,top=80");



}











function div_on_off(arg)



{	



	for(var i=5;i>arg;i--)



	{



		if(i==1)



		{



			if(document.getElementById('state'))



			document.getElementById('state').selectedIndex=0;



		}



		if(i==2)



		{



			if(document.getElementById('region'))



			document.getElementById('region').selectedIndex=0;



			document.getElementById('mydiv2').innerHTML='';



		}



		if(i==3)



		{



			if(document.getElementById('county'))



			document.getElementById('county').selectedIndex=0;



		}



		if(i==4)



		{



			if(document.getElementById('town_region'))



			{



				document.getElementById('town_region').length=0;



			}



			document.getElementById('mydiv4').innerHTML='';



		}



		if(i==5)



		{



			if(document.getElementById('town'))



				document.getElementById('town').length=0;



		}



		document.getElementById('mydiv'+i).style.display='none';



		



	}	



}



function select_state(arg)



{	



	div_on_off(arg);



	var c_id=document.rent.country.value;



	var type=document.rent.type.value;



	sendRequest('bk_srch_panel.php','topic=state&type='+type+'&country='+c_id,'POST');



}



function select_county(arg)



{	



	div_on_off(arg);



	var c_id=document.rent.country.value;



	var s_id=document.getElementById('state').value;//alert(c_id+s_id);



	var type=document.rent.type.value;



	var region = '';



	if(document.getElementById('region'))



		region = '&region='+ document.getElementById('region').value;



	sendRequest('bk_srch_panel.php','topic=county&type='+type+'&country='+c_id+'&state='+s_id+region,'POST');



}



function select_town(arg)



{	



	div_on_off(arg);



	var c_id=document.rent.country.value;



	var s_id=document.rent.state.value;



	var co_id=document.rent.county.value;//alert(c_id+s_id+co_id);



	var type=document.rent.type.value;



	var town_region = '';



	if(document.getElementById('town_region'))



		town_region = '&town_region='+ document.getElementById('town_region').value;



	//alert(town_region);







	sendRequest('bk_srch_panel.php','topic=town&type='+type+'&country='+c_id+'&state='+s_id+'&county='+co_id+town_region,'POST');







}

function editAccount(memid) {

	

	document.getElementById("myProfile").style.display='';

	document.getElementById("myProfile1").style.display='none';

	document.getElementById("ad").className='tabmids';

	document.getElementById("points").className='tabsml';

	//document.getElementById("ss").className='tabmids';

	document.getElementById("edit_acc").className='select';

	document.getElementById("ext_acc").className='';

	document.getElementById("upgrade_acc").className='';

	document.getElementById("purchase_points").className='';

  

  document.getElementById('myProfile').innerHTML="<center><img src='images/loading.gif' width=44 height=39></center>";

	sendRequest("ajaxprocessor/showMyProfile.php","memid="+memid,"POST");

  }

  function extendedAccount(memid,member_type) {

	document.getElementById("myProfile").style.display='';

	document.getElementById("myProfile1").style.display='none';

	document.getElementById("ad").className='tabmids';

	document.getElementById("points").className='tabsml';

	document.getElementById("ss").className='tabmids';

	document.getElementById("edit_acc").className='tabext';

	document.getElementById("ext_acc").className='tabext_select';

	document.getElementById("upgrade_acc").className='tabext';

	document.getElementById("purchase_points").className='tabmids';

    

	document.getElementById('myProfile').innerHTML="<center><img src='images/loading.gif' width=44 height=39></center>";

	sendRequest("ajaxprocessor/extendedAccount.php","memid="+memid+"&member_type="+member_type,"POST");

  }

   function upgradeAccount(memid) {

	document.getElementById("myProfile").style.display='';

	document.getElementById("myProfile1").style.display='none';

	document.getElementById("ad").className='tabmids';

	document.getElementById("points").className='tabsml';

	document.getElementById("ss").className='tabmids';

	document.getElementById("edit_acc").className='tabext';

	document.getElementById("ext_acc").className='tabext';

	document.getElementById("upgrade_acc").className='tabext_select';

	document.getElementById("purchase_points").className='tabmids';

	

    document.getElementById('myProfile').innerHTML="<center><img src='images/loading.gif' width=44 height=39></center>";

	sendRequest("ajaxprocessor/upgradeAccount.php","memid="+memid,"POST");

  }

   function purchasePoints(memid) {

	document.getElementById("myProfile").style.display='';

	document.getElementById("myProfile1").style.display='none';

	document.getElementById("ad").className='tabmids';

	document.getElementById("points").className='tabsml';

	document.getElementById("ss").className='tabmids';

	document.getElementById("edit_acc").className='tabext';

	document.getElementById("ext_acc").className='tabext';

	document.getElementById("upgrade_acc").className='tabext';

	document.getElementById("purchase_points").className='tabmids_select';

    

	document.getElementById('myProfile').innerHTML="<center><img src='images/loading.gif' width=44 height=39></center>";

	sendRequest("ajaxprocessor/purchase_points.php","memid="+memid,"POST");

  }

   function myAccountDetails(memid,tabno) {

	   if(tabno=="1")

	   {

	document.getElementById("ad").className='tabmids_select';

	  /* document.getElementById("div_ad").style.display='';

	document.getElementById("div_point").style.display='none';

	document.getElementById("div_ss").style.display='none';*/

	   }

	else

	document.getElementById("ad").className='tabmids';

	

	

	

	if(tabno=="2")

	{

	document.getElementById("points").className='tabsml_select';

	

	}

	else

	document.getElementById("points").className='tabsml';

	

	/*if(tabno=="3")

	{

	document.getElementById("ss").className='tabmids_select';

		

	}

	else

	document.getElementById("ss").className='tabmids';

	*/

	document.getElementById("edit_acc").className='';

	document.getElementById("ext_acc").className='';

	document.getElementById("upgrade_acc").className='';

	document.getElementById("purchase_points").className='';

    

	document.getElementById('myProfile').innerHTML="<center><img src='images/loading.gif' width=44 height=39></center>";

	sendRequest("ajaxprocessor/myAccountDetails.php","mem_id="+memid+"&tabno="+tabno,"POST");

  }

function check_availiability_of_user() {

  var username;

  username = document.confirm_frm.username.value;

 //alert(username);

 if(username=="")

 {

 document.getElementById("msg").innerHTML="User field should not be blank.";

		

		

		document.confirm_frm.username.focus();

		window.scroll(0,0);

		return false;

 }

 

  sendRequest('ajaxprocessor/check_availiability_of_userid.php',"username="+username,"POST");

}

function onReadyState()



{



	var data=null;



	if (req.readyState==READY_STATE_COMPLETE)



	{



		var xmlDoc = req.responseText;

		

		//alert(xmlDoc);



		var pos=xmlDoc.indexOf('^');



		var len=xmlDoc.length;



		var content=xmlDoc.substring(0,pos);



		var text=xmlDoc.substring(pos+1,len);



		var pos2=text.indexOf('^');



		var n2=text.substring(0,pos2);



		var topic=text.substring(pos2+1,text.length);



		var num=parseInt(topic);

		



		if(n2==1)



		{



			document.getElementById("mydiv1").innerHTML=content;



			document.getElementById("mydiv1").style.display='';



			document.rent.state.focus();







		}



		if(n2==2)



		{



			document.getElementById("mydiv3").style.display='';



			document.getElementById("mydiv3").innerHTML=content;



			document.rent.county.focus();











		}



		if(n2==3)



		{



			document.getElementById("mydiv5").innerHTML=content;



			document.getElementById("mydiv5").style.display='';



			document.getElementById('town').focus();







		}



		if(n2==4)



		{



			document.getElementById("mydiv2").innerHTML=content;



			document.getElementById("mydiv2").style.display='';



			document.getElementById('region').focus();







		}



		if(n2==5)



		{



			document.getElementById("mydiv4").innerHTML=content;



			document.getElementById("mydiv4").style.display='';



			document.getElementById('town_region').focus();







		}

if(text==111)



		{



			document.getElementById("msg").innerHTML=content;



			document.getElementById("msg").style.display='';



			document.getElementById('username').focus();







		}

if(text==112)



		{

//alert("hi");

			document.getElementById("msg").innerHTML=content;



			document.getElementById("msg").style.display='none';



			//document.getElementById('username').focus();







		}

		if(text==18) 

			{

				document.getElementById("myProfile").innerHTML = content; 

			}

			

		if(text==245)



		{

			

			document.getElementById("msg").innerHTML='<img src="images/icon.gif">'+content;



		}

			

		if(text==244)



		{

			

			document.getElementById("msg").innerHTML=content;



			//document.getElementById("msg").style.display='';



			document.getElementById('nick_name').focus();







		}

		if(text==1000)



		{

		document.getElementById('comment_return').innerHTML=content;	

		document.getElementById("comment_return").style.display = "block";

		setTimeout("hidediv('comment_return')", 10000);

		document.getElementById('com_name').value='';

		document.getElementById('com_location').value='';

		document.getElementById('com_email').value='';

		document.getElementById('comment_content').value='';

		}

		if(text==999)



		{

			var mc=content.split('#');

			var mc2=mc[1].split('@');

			var divnm='favourites-'+mc2[0];

			document.getElementById(divnm).innerHTML=mc[0];

			if(mc2[1]>1){

				document.getElementById('cookie_count').innerHTML='You have '+mc2[1]+' Favourites';

				document.getElementById('cookie_count_1').innerHTML=mc2[1];

				document.getElementById('cookie_count_2').innerHTML=mc2[1];

			}

			else

			{

				document.getElementById('cookie_count').innerHTML='You have '+mc2[1]+' Favourite';

				document.getElementById('cookie_count_1').innerHTML=mc2[1];

				document.getElementById('cookie_count_2').innerHTML=mc2[1];

			}

			

			



		}

		var myRegExp = /div-/;

		var matchPos1 = text.search(myRegExp);



		if(matchPos1!=-1)



		{

			var n5;

			var n6;

			var valdiv;

			

			n5=text.split('-');

			n6=n5[1];

			

			valdiv2='vmsg' + n6	;

			

			valdiv2=removeSpaces(ltrim(rtrim(valdiv2)));

			

			document.getElementById(valdiv2).innerHTML=content;



		}

		

		

if(text==19) 

{

	document.getElementById("myProfile").innerHTML = content; 

}

if(text==20) 

{

	document.getElementById("myProfile").innerHTML = content; 

}

if(text==21) 

{

	document.getElementById("myProfile").innerHTML = content; 

}

if(text==22) 

{

	document.getElementById("myProfile").innerHTML = content; 

}

	req.abort();



	}



}





	function abc()



	{

if(document.getElementById('username').value=="username")

{

document.getElementById('username').value="";	

}

 if(document.getElementById('password').value=="password")

 {

	 document.getElementById('password').value="";

	 }

		if(document.logfrm.email.value == "")



		{



			alert("Username cannot be blank");



			document.logfrm.email.focus();



			return false;



		}



		if(document.logfrm.password.value == "")



		{



			alert("Password cannot be blank");



			document.logfrm.password.focus();



			return false;



		}



	return true;



	}



function abc2()



	{



		if(document.logfrm5.email.value == "")



		{



			alert("Username cannot be blank");



			document.logfrm5.email.focus();



			return false;



		}



		if(document.logfrm5.password.value == "")



		{



			alert("Password cannot be blank");



			document.logfrm5.password.focus();



			return false;



		}



	return true;



	}

	function confirm_login()



	{

		

		if(document.getElementById("msg").innerText == "This username already exist.")



		{

            

			alert("Username already exist!");

           document.confirm_frm.username.value == "";

			document.confirm_frm.username.focus();



			return false;



		}



		if(document.confirm_frm.username.value == "")



		{



			alert("Username cannot be blank");



			document.confirm_frm.username.focus();



			return false;



		}



		if(document.confirm_frm.password.value == "")



		{



			alert("Password cannot be blank");



			document.confirm_frm.password.focus();



			return false;



		}

		



	return true;



	}

	function removeSpaces(str) {

		re = /\$|@|#|~|`|\%|\*|\^|\&|\+|\=|\[|\-|\]|\[|\}|\{|\;|\:|\"|\<|\>|\?|\||\\|\!|\$|\./g;

		plus = /\$|,|@|#|~|`|\%|\*|\^|\&|\|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\"|\<|\>|\?|\||\\|\!|\$|\./g;

			  // remove special characters like "$" and "," etc...

			  var actualValue= str.replace(re, "-");

			  var actualValue= actualValue.replace(plus, "=");

			  var actualValue= actualValue.replace("'", "*");

			  return actualValue=(actualValue.replace (/\s+/g, '-'))

		}

	function ltrim(stringToTrim) {

		return stringToTrim.replace(/^\s+/,"");

		}

		

		function rtrim(stringToTrim) {

		return stringToTrim.replace(/\s+$/,"");

		}





	function rentchecked(event)



    {	



		var request_string='';

		var request_stringg='';

		var request_string2='';

		var propertytype='';



		var type='';

		type=document.getElementById('type').value;

		

		propertytype=document.getElementById('propertytype').value;

		if(propertytype!='')

		{

		 request_string=removeSpaces(ltrim(rtrim(propertytype)));

		}

		else

		{

		 request_string='All';

		}

		

		

		

		var country='';

		

		country=document.getElementById('country').value;

		

		if(country!='')

		{

		request_stringg='_in_'+removeSpaces(ltrim(rtrim(country)))+'.c';

		}

		

		

		var state='';

		state=document.getElementById('state').value;

		if(state!='')

		{

		request_stringg='_in_'+removeSpaces(ltrim(rtrim(state)))+'.s';

		}

		

		

		if(document.getElementById('town_region') && document.getElementById('town_region').value!='')

		{

			

			region=document.getElementById('town_region').value;

			request_stringg='_in_'+removeSpaces(ltrim(rtrim(region)))+'.tr';

			//alert(request_string);

						

		}

		else if(document.getElementById('region') && document.getElementById('region').value!='')

		{

			

			region=document.getElementById('region').value;

			request_stringg='_in_'+removeSpaces(ltrim(rtrim(region)))+'.r';

			//alert(request_string);

			

		}



		var county='';

		county=document.getElementById('county').value;

		if(county!='')

		{

		request_stringg='_in_'+removeSpaces(ltrim(rtrim(county)))+'.cn';

		}

		

		

		

		

		var town='';

		var cnt=0;

		var option_cnt=document.rent.town.length;

		

		if(option_cnt>0)

		{

			for (i=0; i<document.rent.town.length;i++)

			{

				if (document.rent.town[i].selected && document.rent.town[i].value!='' )

				{

					town=document.rent.town[i].value;

					cnt++;

					if(cnt==1)

					{

					request_string2+='_in_'+removeSpaces(ltrim(rtrim(town)));

					}

					else

					{

					request_string2+=','+removeSpaces(ltrim(rtrim(town)));

					}

					

				}

			}

			if(cnt>0)

			{

			request_stringg=request_string2+'.t';

			}

			

		}

		

		request_string+=request_stringg;



		//alert(request_stringg);		

		var bedrooms='';



		bedrooms=document.getElementById('bedrooms').value;



		if(bedrooms!='')

		{

		request_string+='+'+bedrooms+'.bedrooms';

		}

				

		

		var bathrooms='';

		bathrooms=document.getElementById('bathrooms').value;

		if(bathrooms!='')

		{

		request_string+='+'+bathrooms+'.bathrooms';

		}

			

		

		var favour='';

		

		if(document.getElementById('favour').checked)

		{

		favour=document.getElementById('favour').value;

		request_string+='+'+favour+'.favour';

		}

		

		

		

		var offer='';

		

		if(document.getElementById('offer').checked)

		{

		offer=document.getElementById('offer').value;

		request_string+='+'+offer+'.offer';

		}

		if(document.getElementById('availability').checked==true)
		{
			if(document.getElementById('avl_travel_dt').value=='')
			{
				alert('please enter travel date.');
				document.getElementById('avl_travel_dt').focus();
				return false;
			}
			if(document.getElementById('avl_no_nights').value=='')
			{
				alert('please enter number of nights.');
				document.getElementById('avl_no_nights').focus();
				return false;
			}
		}

		var memid='';

		memid=document.getElementById('memid').value;

		if(memid!='')

		{

		request_string+='+'+memid+'.memid';

		}

			

			

		var keyword='';

		keyword=document.getElementById('keyword').value;

		if(keyword!='')

		{

		request_string+='+'+removeSpaces(keyword)+'.keyword';

		}

				

		var target = event.target || event.srcElement;



		if(target.id=='srchpropid')



		{



			prop();



		}



		else



		{	

			var str;

			str=request_string;

			var strmatch=str.substr(0,1);

			

			if(strmatch=='+')

			{   

				var len;

				len=str.length;

				request_string=str.substr(1,len);

			}

			else

			{

				

			}

			//alert(request_string);

			document.rent.action =type+"s/"+request_string;

			//document.rent.action ="searchs.php/"+type+"s/"+request_string;

			//document.rent.action ="searchs.php";

			document.rent.submit(); 

		}



    }

function allchecked()



{ 

var hidden=document.getElementById('keyword1_hidden').value;



var hidden2=hidden.split("^^");



document.getElementById('keyword1_hidden').value=hidden2[0];



//var urls=hidden2[1].replace("http://www.holidayhomeads.com/","http://localhost:90/holiday/");



var urls=hidden2[1];



//window.location.href =urls;



document.rent1.action =urls;



document.rent1.submit();



}

function prop()



{



	if(document.rent.srchpropid.value!="")	



	{



		window.status="test in";



		window.location.href='Pviewdetails-'+document.rent.srchpropid.value;



	}



	else



	{



		alert("Please enter a property no. in the \"Property No\" field.");



		document.rent.srchpropid.focus();



		return false;



	}



}



function getKeyCode(e)



{



 if (window.event)



    return window.event.keyCode;



 else if (e)



    return e.which;



 else



    return null;



}



function keyRestrict(e, validchars) 



{



 var key='', keychar='';



 key = getKeyCode(e);



 if (key == null) return true;



 keychar = String.fromCharCode(key);



 keychar = keychar.toLowerCase();



 validchars = validchars.toLowerCase();



 if (validchars.indexOf(keychar) != -1)



  return true;



 if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )



  return true;



 return false;



}


function reset1(arg)



{
    arg.propertytype.selectedIndex=0;

    arg.country.selectedIndex=0;

    arg.state.selectedIndex=0;

	if(arg.region)

		arg.region.selectedIndex=0;

    arg.county.selectedIndex=0;

	if(arg.town_region)

		arg.town_region.selectedIndex=0;

    arg.town.length=0;

    arg.bedrooms.selectedIndex=0;

    arg.bathrooms.selectedIndex=0;

    arg.keyword.value="";

    arg.favour.checked=false;

    arg.offer.checked=false;

    arg.show_map.checked=true;
	
	arg.availability.checked=false;
		
	arg.avl_travel_dt.value="";
	
	arg.avl_no_nights.value="";
	
	$j("#advance_searchbox_avilability").slideUp("slow");

    document.getElementById('mydiv1').style.display='none';

    document.getElementById('mydiv2').style.display='none';

    document.getElementById('mydiv3').style.display='none';

	document.getElementById('mydiv4').style.display='none';

	document.getElementById('mydiv5').style.display='none';

}





function opendiv()

{



if(document.getElementById("disstatus").value=="0")

{

document.getElementById("hideme").innerHTML="Close Advanced Search";

//document.getElementById("advance_searchbox").style.display="";

  $j("#advance_searchbox").slideDown("slow");

document.getElementById("disstatus").value="1";

}

else

{

document.getElementById("hideme").innerHTML="Advanced Search";

  $j("#advance_searchbox").slideUp("slow");

document.getElementById("disstatus").value="0";

}

}

function opendivAvailabity()
{

if(document.getElementById("availability").checked)
{
$j("#advance_searchbox_avilability").slideDown("slow");
}
else
{
$j("#advance_searchbox_avilability").slideUp("slow");
}
}

function menu_colapse11()

{

	

if(document.getElementById("bed1").className =="sortitem_col")

{



document.getElementById("bed1").className ="sortitem";

//document.getElementById(id2).style.display="none";

$j("#bedid").slideUp("slow");

}

else

{

document.getElementById("bed1").className ="sortitem_col";

//document.getElementById(id2).style.display="";

$j("#bedid").slideDown("slow");

}



}

function menu_colapse12()

{

	

if(document.getElementById("property").className =="sortitem_col")

{



document.getElementById("property").className ="sortitem";

//document.getElementById(id2).style.display="none";

$j("#property1").slideUp("slow");

}

else

{

document.getElementById("property").className ="sortitem_col";

//document.getElementById(id2).style.display="";

$j("#property1").slideDown("slow");

}



}

function menu_colapse13()

{

if(document.getElementById("location").className =="sortitem_col")

{



document.getElementById("location").className ="sortitem";

//document.getElementById(id2).style.display="none";

$j("#location1").slideUp("slow");

}

else

{

document.getElementById("location").className ="sortitem_col";

//document.getElementById(id2).style.display="";

$j("#location1").slideDown("slow");

}



}

function bookmarksite(title,url){

	



if (window.sidebar) // firefox



	window.sidebar.addPanel(title, url, "");



else if(window.opera && window.print){ // opera



	var elem = document.createElement('a');



	elem.setAttribute('href',url);



	elem.setAttribute('title',title);



	elem.setAttribute('rel','sidebar');



	elem.click();



} 



else // if(document.all)// ie



	window.external.AddFavorite(url, title);



}

function div_hide(id)

{

	if(id=='imgid'){

	document.getElementById(id).className='select';

	document.getElementById('mapid').className='';

	document.getElementById("gallery1").style.display='';

	document.getElementById("mapp").style.display='none';

	

	}

	else

	{

	document.getElementById(id).className='select';

	document.getElementById('imgid').className='';

	document.getElementById("gallery1").style.display='none';

	document.getElementById("mapp").style.display='';

	}

	

}

function check_availiability_of_nickname() {

  var nickname;

  nickname = document.frm.nick_name.value;

	 if(nickname=="")

	 {

	 document.getElementById("msg").innerHTML="Nickname field should not be blank.";

	 document.frm.nick_name.focus();

	 //window.scroll(0,0);

	 return false;

	 }

 	else

	{

  	sendRequest('ajaxprocessor/check_availiability_of_nickname.php',"nick_name="+nickname,"POST");

	}

}

function votehelp(id,status) {

 

	if(status=="false")

	{

     valdiv='vmsg' + id	;

	 document.getElementById(valdiv).innerHTML="<span style='color:#009966'><strong> Thanks for voting!.</strong></span>";

	}

 	if(status=="true")

	{

  	sendRequest('ajaxprocessor/vote.php',"id="+id,"POST");

	}

}

function menu_colapse(val,val2)

{

	var var2='#'+val2;

	if(document.getElementById(val).className =="sortitem")

	{

	document.getElementById(val).className ="sortitem_col";

	$j(var2).slideUp("slow");

	}

	else

	{

	document.getElementById(val).className ="sortitem";

	$j(var2).slideDown("slow");

	}

}

function fav(arg,arg2)



{	



	if(arg2=='addfav'){



	sendRequest('ajaxfavourites.php','favtype=addfav&favpropertyid='+arg,'POST');

	

	}

	if(arg2=='delfav'){



	sendRequest('ajaxfavourites.php','favtype=delfav&favpropertyid='+arg,'POST');

	

	}



}

function check_email(str)

{

var str;

var length=str.length

		  var indx0=str.indexOf(" ");

		  var indx1=str.indexOf("@");

		  var indx2=str.indexOf(".");

		  var indx3=str.length;

		  if((indx1<=0) || (indx2<=0) || (indx0>=1) || (indx2==length))

		  {

			

			alert("Email field is not proper format");

			return false;

		  }

		  return true;

}

function chkcomment()

{

	if(document.comfrm.com_name.value=="")



		{



			alert("Please enter name");



			document.comfrm.com_name.focus();



			return false;



		}

	if(document.comfrm.com_email.value == "")



	{



		alert("Email address cannot be blank");



		document.comfrm.com_email.focus();



		return false;



	}



	if(!check_email(document.comfrm.com_email.value))



	{



		document.comfrm.com_email.focus();



		return false;



	}

	if(document.comfrm.com_location.value=="")



		{



			alert("Please enter your location");



			document.comfrm.com_location.focus();



			return false;



		}

	if(document.comfrm.comment_content.value=="")



		{



			alert("Please enter your comment");



			document.comfrm.comment_content.focus();



			return false;



		}	





		

			

	return true;	

}

function get(obj) {

      

	    var com_name=obj.com_name.value;

	    var com_email=obj.com_email.value;

		var com_location=obj.com_location.value;

	    var comment_content=obj.comment_content.value;

		var comment_country=obj.comment_country.value;

		var comment_state=obj.comment_state.value;

		var comment_county=obj.comment_county.value;

		var comment_town=obj.comment_town.value;

		var comment_county_region=obj.comment_county_region.value;

		var comment_town_region=obj.comment_town_region.value;

		var comment_url=obj.comment_url.value;

		

		var getstr='com_name='+com_name+'&com_email='+com_email+'&comment_content='+comment_content+'&comment_country='+comment_country+'&comment_state='+comment_state+'&comment_county='+comment_county+'&comment_town='+comment_town+'&comment_county_region='+comment_county_region+'&comment_town_region='+comment_town_region+'&comment_url='+comment_url+'&com_location='+com_location;



	    sendRequest('command_post.php',getstr,'POST');

    }

function hidediv(arg) {

    document.getElementById(arg).style.display = 'none';

}	
