var icount = 0;var curDomain=document.domain;
function dgebid(obj){
		if(document.getElementById){
			if(document.getElementById(obj)!=null){return document.getElementById(obj)}else{return "";}
		}else if(document.all){
			if(document.all[obj]!=null){return document.all[obj]}else{return "";}
		}
	}
function tab(nid,id,ttab,cname,csson,cssoff) {		
	for (i=1; i<=ttab; i++){
		var container = cname + i;
		if(nid+id == nid+i){dgebid(container).style.display = "block"; dgebid(nid+i).className= csson;}
		else{dgebid(container).style.display = "none"; dgebid(nid+i).className= cssoff;}
	}
}

function loadStory(v){
	//if(document.getElementById('SSMID')){document.getElementById('SSMID').innerHTML=banner[v]['MID'];}
	if(document.getElementById('SSCOUPLENAMES')){document.getElementById('SSCOUPLENAMES').innerHTML=banner[v]['COUPLENAMES'];}
	if(document.getElementById('SSSTORY')){document.getElementById('SSSTORY').innerHTML=banner[v]['STORY'];}
	if(document.getElementById('SSIMG')){document.getElementById('SSIMG').innerHTML="<img src='"+ss_impath+banner[v]['MID']+".jpg' width='121' class='imgborder' height='81' border='0' alt='' />";}
}

function prev(){if (icount==0){icount=banner.length-1;  loadStory(icount);} else{var l = icount-=1; loadStory(l);}}
function next(){var l = icount+=1; if (l>=banner.length){icount=0; loadStory(icount);}else{loadStory(l);}}

var awards_impath="http://imgs.bharatmatrimony.com/bmimgs/";	
var award=new Array();
award[0]=new Array(); award[0]['AWID']=['awards-2']; award[0]['AWARDTITLE']=['Top 50 companies in India, 2011- Deloitte']; award[0]['AWARDCONT']=['BharatMatrimony was ranked one among in the Deloitte Technology Fast 50 India 2011. Also recognized in 2008 & 2009.'];
award[1]=new Array(); award[1]['AWID']=['awards-3']; award[1]['AWARDTITLE']=['Used by 80% Indians - Juxt Consult 2011 Survey']; award[1]['AWARDCONT']=['JuxtConsult\'s 2011 India Online Survey reports that 80% of Indians use BharatMatrimony for their partner search. <a href="http://www.bharatmatrimony.com/awards/juxtconsult.php" target="_blank">More</a>'];
award[2]=new Array();award[2]['AWID']=['awards-1']; award[2]['AWARDTITLE']=['Limca Book of Records']; award[2]['AWARDCONT']=['BharatMatrimony has found a place in the Limca Book of Records for record number of documented marriages online. <a href="http://www.bharatmatrimony.com/awards/limca-award.php" target="_blank">More</a>'];
award[3]=new Array(); award[3]['AWID']=['awards-4']; award[3]['AWARDTITLE']=['NASSCOM IT Innovators']; award[3]['AWARDCONT']=['BharatMatrimony is listed as one of the top 50 companies in NASSCOM\'s 100 IT Innovators. <a href="http://www.bharatmatrimony.com/awards/nasscom-it-innovators.php" target="_blank">More</a>'];
award[4]=new Array(); award[4]['AWID']=['awards-5']; award[4]['AWARDTITLE']=['Red Herring 100 Global Award']; award[4]['AWARDCONT']=['Consim Info. Pvt. Ltd, of which BharatMatrimony is a part, won the Red Herring 100 Global Award for being one of the most innovative companies in the world.'];

var awardcount = 0;
function loadAward(v){
	//if(document.getElementById('AWARDIMAGE')){document.getElementById('AWARDIMAGE').innerHTML=award[v]['AWID'];}
	if(document.getElementById('AWARDHEADER')){document.getElementById('AWARDHEADER').innerHTML=award[v]['AWARDTITLE'];}
	if(document.getElementById('AWARDTEXT')){document.getElementById('AWARDTEXT').innerHTML=award[v]['AWARDCONT'];}
	if(document.getElementById('AWARDIMG')){document.getElementById('AWARDIMG').innerHTML="<img src='"+awards_impath+award[v]['AWID']+".gif' width='167' class='imgborder' height='87' border='0' alt='' />";}
}

function prevaward(){if (awardcount==0){awardcount=award.length-1; loadAward(awardcount);} else{var l = awardcount-=1; loadAward(l);}}
function nextaward(){var l = awardcount+=1; if (l>=award.length){awardcount=0; loadAward(awardcount);}else{loadAward(l);}}


function getAjaxRes(url,params,divid){
	var http = new GetXmlHttpObject();
	http.open("GET", url, true);
	http.onreadystatechange = function(){
		if(http.readyState == 4 && http.status == 200) dgebid(divid).innerHTML = http.responseText;	
	}
	http.send(params);
}
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{xmlHttp=new XMLHttpRequest();}
	catch (e){// Internet Explorer
		try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
	}
	return xmlHttp;
}

/* Forgot Password */
function postdetail(pageload){
	if(document.getElementById("forgotpwd").value == ''){
		document.getElementById('error').innerHTML="Enter valid Matrimony ID or E-mail ID.";						
		document.getElementById('forgotpwd').focus();		
		return false;
	}else{			
		var rand=Math.random(9999);
		var params="rand="+rand+"&ID="+encodeURI(document.getElementById("forgotpwd").value);
		MakePostRequest(pageload,params,handleForgetPassword)
		return false;
	}
}

function handleForgetPassword(){
	try{ 
		domainSplit = curDomain.split('.');	
		document.getElementById('innerdisp').innerHTML='';
		document.getElementById('dispcontent').innerHTML = '<div style="padding-top:50px"><center><img src="http://imgs.'+domainSplit[1]+'.com/bmimgs/small_loading.gif"></center></div>';
		if(ajobj.readyState==4){			
			var results=ajobj.responseText;			
			splitResponse = results.split('~');
			if(splitResponse[1]==1)
			{
				document.getElementById('GET').style.height='70px';
			}
			document.getElementById('innerdisp').style.display='none';
			document.getElementById('dispcontent').innerHTML=splitResponse[0];
		}
	}catch(e){}
}

function tollfreenumber(id){
	if (id == "usa"){
		var id = "1-888-824-6146";
		document.write(id);
	}else if (id == "uk"){
		var id = "0-808-168-3055"
		document.write(id);
	}else if (id =="singapore"){
		var id = "8001012537";
		document.write(id);
	}else if (id=="australia"){
		var id = "1800093053";
		document.write(id);
	}else if (id=="uae"){
		var id = "&#43;971-4-3968637<br />Sat-Thu: 9.00 AM to 9.00 PM.<br />Friday: 10.00 AM to 5.00 PM.";
		document.write(id);
	}else if (id=="malaysia"){
		var id = "03-61855523 / 1800815588";
		document.write(id);
	}else if (id=="others"){
		var id = "91-44-39115000";
		document.write(id);
	}else if (id=="india"){
		var id = "1800-3000-3344<br />1800-425-3344 <font class='smalltxt1'>(BSNL/MTNL Users)</font>";
		document.write(id);
	}else if (id=="canada"){
		var id = "1-888-824-6146";
		document.write(id);		
	}
}

function validateById(){
	var MatriFormSBID= this.document.MatriFormSBID;
	if(IsEmpty(MatriFormSBID.SSID,'text')){
		show_menu('2', this, '121'); subTabTimeout('menu_block2','tab1','2'); show_hide_sbid("show");
		alert("Please enter Matrimony ID.");
		return false;
	}
	else{ return true; }
}

function frmvalidbyid(){
	if(!validateById()){ return false; }
	document.MatriFormSBID.action="http://"+DOMAINARRAY['domainmodule']+"/profiledetail/viewprofile.php";
	return true;
}
