//================

function addToShortList(id,spanidnone,spanidblock,phpfile)
{
document.getElementById(spanidnone).style.display = "none"
//document.getElementById("img"+id+"1").style.display = "block"
//************
	xmlhttp = GetXmlHttpObject()

		xmlhttp.onreadystatechange = function (){
			if(xmlhttp.readyState == 4)
			{	

				//document.getElementById("img"+id+"1").style.display = "none"
				document.getElementById(spanidblock).style.display = "block"
				//document.getElementById(obj).innerHTML=	
				document.getElementById("bg_saved").innerHTML = xmlhttp.responseText
				
				
				}
				
			}
	xmlhttp.open("GET",phpfile+"?id="+id,true);
	xmlhttp.send(null)
}

//================
//================
function refreshcaptcha(frmid,PId){
	document.getElementById(PId).src = frmid

	}
	
//	=====================


function validate(obj){
	
	if(obj.youremail.value == ''){
	alert("Please enter your email")
	obj.youremail.focus()
	return false
	}else if(!emailCheck(obj.youremail.value)){
	obj.youremail.focus()
	return false
	}else if(obj.friendsEmail.value == ''){	
	alert("Please enter your friendsEmail")
	obj.friendsEmail.focus()
	return false
	}else if(!emailCheck(obj.friendsEmail.value)){
	obj.friendsEmail.focus()
	return false
	}else if(obj.captcha.value == '' || obj.captcha.value == 'Enter Code'){	
	alert("Please enter the Code")
	obj.captcha.focus()
	return false
	}
	obj.submitbtn.value = "Please wait.."
//=============Send data through Ajax
xmlHttp=GetXmlHttpObject()
xmlHttp.onreadystatechange=function (){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 
	 if(xmlHttp.responseText == 1){
		 alert('Security Code Mismatch')
		 obj.submitbtn.value = "Send"
		 obj.captcha.focus()
		 }else{
	 obj.submitbtn.value = "Sent"
	 obj.onsubmit = returnfalse
	 obj.youremail.value = ''
	 obj.friendsEmail.value = ''
	 obj.captcha.value = ''
	 
	 
		 }
	 
	 
	
//obj.submitbtn.disabled = true
} 

}
myemail = obj.youremail.value
friendEmail = obj.friendsEmail.value
capthcha = obj.captcha.value
proId = obj.propId.value
xmlHttp.open("GET","emailProperty.php?myemail="+myemail+"&friendEmail="+friendEmail+"&capthcha="+capthcha+"&Id="+proId,true)
xmlHttp.send(null)
return false;
//====END

}
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;

	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}


function subMenu(){
	document.getElementById('Link-Lifestyle').onmouseover = function () {document.getElementById('subMenu').style.display='block';}
	document.getElementById('Link-Lifestyle').onmouseout = function () {document.getElementById('subMenu').style.display='none';}
	document.getElementById('subMenu').onmouseover = function () {this.style.display='block';}
	document.getElementById('subMenu').onmouseout = function () {this.style.display='none';}

}

function SubmitBlue()
{
	var x = getElementsByClass('SubmitBlue',null,'input');
	for (var i=0;i<x.length;i++)
	{
		x[i].onmouseover = function () {this.style.backgroundPosition='0 -26px';}
		x[i].onmouseout = function () {this.style.backgroundPosition='0 0';}

	}
}


function form_b()
{
	if (document.getElementsByTagName)
		var x = document.getElementsByTagName('input');
	else if (document.all)
		var x = document.all.tags('input');
	else return;
	for (var i=0;i<x.length;i++)
	{
		x[i].onclick = function () {this.value='';}
	}
}

function index() {

	document.getElementById('Prop-Search_a').onmouseover = function () {document.getElementById('h2_Prop-Search').style.backgroundPosition='0 -132px';}
	document.getElementById('Prop-Search_a').onmouseout = function () {document.getElementById('h2_Prop-Search').style.backgroundPosition='0 0';}

	document.getElementById('Mobile-Box_a').onmouseover = function () {document.getElementById('h2_Mobile-Box').style.backgroundPosition='0 -132px';}
	document.getElementById('Mobile-Box_a').onmouseout = function () {document.getElementById('h2_Mobile-Box').style.backgroundPosition='0 -33px';}

	document.getElementById('Podcast-Box_a').onmouseover = function () {document.getElementById('h2_Podcast-Box').style.backgroundPosition='0 -132px';}
	document.getElementById('Podcast-Box_a').onmouseout = function () {document.getElementById('h2_Podcast-Box').style.backgroundPosition='0 -66px';}

	document.getElementById('Windows-Vista_a').onmouseover = function () {document.getElementById('h2_Windows-Vista').style.backgroundPosition='0 -132px';}
	document.getElementById('Windows-Vista_a').onmouseout = function () {document.getElementById('h2_Windows-Vista').style.backgroundPosition='0 -99px';}
	
}



function mail_f(box) {
	id_1 = 'mail_a_'+box;
	id_2 = "mail_f_"+box;
	list = "listing"+box;
	document.getElementById(id_2).style.display='block';
	document.getElementById(id_1).style.display='none';
	document.getElementById(list).style.height = '520px'
	
}


function mail_f_1(box) {
	id_1 = 'mail_a_'+box;
	id_2 = "mail_f_"+box;
	
	list = "listing"+box;
	
	document.getElementById(id_1).style.display='block';
	document.getElementById(id_2).style.display='none';
	document.getElementById(list).style.height=''
}





function mortage_calculator_box() {
	document.getElementById('box_mortage_calculator_a').style.display='block';
	document.getElementById('det_l1').style.display='none';
}
function mortage_calculator_box_a() {
	document.getElementById('det_l1').style.display='block';
	document.getElementById('box_mortage_calculator_a').style.display='none';
}

/*function addEmail(em){
	
document.getElementById("newsletter_id").value = "Please wait.."	
if(!emailCheck(em.value)){
	em.focus()
	return false
	}else{
	
	xmlhttp = GetXmlHttpObject()
	
			
	xmlhttp.onreadystatechange = function (){
	if(xmlhttp.readyState == 4)
	{	
		//alert("Email Added Successfully")
		document.getElementById("newsletter_id").value = "Sent"	
		document.getElementById("newsletter_id").disabled = true	
		em.value = ''
		}
		
	}
	xmlhttp.open("GET","NewsletterAdd.php?em="+em.value,true);
	xmlhttp.send(null)
	

	}
return false
}*/

function addText(id,code)
{
	if(document.getElementById(id).value == '')
  document.getElementById(id).value = code;
}
function removeText()
{
  document.getElementById("propRef_id").value = "";
}
function addTextEmail()
{
  document.getElementById("email_id").value = "Enter Your Email.";
}
function removeTextEmail()
{
  document.getElementById("email_id").value = "";
}