function bbbshow(){
        
		getCenter('mmymmsg');
        document.getElementById('mmymmsg').style.display='block';
		//alert(document.getElementById('mmymmsg').style.display);
        getHHH();
        document.getElementById('cmain').style.display='block';
}

function advshow(){
        
		getCenter2('advsearch');
        document.getElementById('advsearch').style.display='block';
		//alert(document.getElementById('mmymmsg').style.display);
        getHHH();
        document.getElementById('cmain').style.display='block';
}

function safetyshow(){
        
		getCenter2('safety');
        document.getElementById('safety').style.display='block';
		//alert(document.getElementById('mmymmsg').style.display);
        getHHH();
        document.getElementById('cmain').style.display='block';
}

function learnmoreshow(){
        
		getCenter2('learnmore');
        document.getElementById('learnmore').style.display='block';
		//alert(document.getElementById('mmymmsg').style.display);
        getHHH();
        document.getElementById('cmain').style.display='block';
}

function getCenter(divid) {
			var myWidth = 0, myHeight = 0;var mH = 150;
			if( typeof( window.innerWidth ) == 'number' ) { // Non-IE
			myWidth = window.innerWidth;myHeight = window.innerHeight;
			} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;myHeight = document.documentElement.clientHeight;
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;myHeight = document.body.clientHeight;
			}
			scc = getScrollXY();
			var sc = scc[1];
			var sc2 = scc[0];var 
			maxpageH = getHHH2();
			//alert(sc+'--'+myHeight+'--'+mH+'--'+maxpageH);
			//alert(myWidth);
			if (navigator.userAgent.indexOf("Firefox")!=-1){
					document.getElementById(divid).style.marginTop = sc + ((myHeight - mH)/2)  + "px";
					document.getElementById(divid).style.left = (myWidth)/2-175 +"px";
			}else{
					document.getElementById(divid).style.marginTop = sc + ((myHeight - mH)/2)  + "px";
					document.getElementById(divid).style.left = (myWidth)/2-175 +"px";
			}
			//alert(document.getElementById('mmymmsg').style.marginTop);
			//alert(document.getElementById('mmymmsg').style.marginLeft);
}

function getCenter2(divid) {
			var myWidth = 0, myHeight = 0;var mH = 150;
			if( typeof( window.innerWidth ) == 'number' ) { // Non-IE
			myWidth = window.innerWidth;myHeight = window.innerHeight;
			} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;myHeight = document.documentElement.clientHeight;
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;myHeight = document.body.clientHeight;
			}
			scc = getScrollXY();
			var sc = scc[1];
			var sc2 = scc[0];var 
			maxpageH = getHHH2();
			//alert(sc+'--'+myHeight+'--'+mH+'--'+maxpageH);
			//alert(myWidth);
			
			if (navigator.userAgent.indexOf("Firefox")!=-1){
					document.getElementById(divid).style.marginTop = "300px";
					document.getElementById(divid).style.left = (myWidth)/2-250 +"px";
			}else{
					document.getElementById(divid).style.marginTop = "300px";
					document.getElementById(divid).style.left = (myWidth)/2-250 +"px";
			}
			//alert(document.getElementById('mmymmsg').style.marginTop);
			//alert(document.getElementById('mmymmsg').style.marginLeft);
        
}

function getHHH() {
	var pageHeight = getHHH2();
	document.getElementById('cmain').style.height = (pageHeight + 15) + "px";
}

function getScrollXY() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {//Netscape compliant
		scrOfY = window.pageYOffset;scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {	//DOM compliant
		scrOfY = document.body.scrollTop;scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;scrOfX = document.documentElement.scrollLeft;}return [ scrOfX, scrOfY ];
}

function getHHH2() {
	if( window.innerHeight && window.scrollMaxY ) // Firefox 
	{
	pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
	{
	pageHeight = document.body.scrollHeight;
	}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	{ pageHeight = document.body.offsetHeight + document.body.offsetTop; }
	return pageHeight;
}

function pads(action) {
if(action=="new"){
document.getElementById("Ss3New").id="s3New";
document.getElementById("Ss3Mp").id="s3Mp";
}
if(action=="mopo"){
document.getElementById("s3New").id="Ss3New";
document.getElementById("s3Mp").id="Ss3Mp";
}

//ajaxEngine.sendRequest( "pads","action="+action,"oDiv=s3Con");
}

function makeactive(tab,type,siteUrl,targetId) { 
document.getElementById("tab1").className = ""; 
document.getElementById("tab2").className = ""; 
document.getElementById("tab3").className = "";
document.getElementById("tab"+tab).className = "active";

makeRequest('action=getAds&type='+type,targetId,siteUrl);
} 

function makeactivenormal(tab,type,siteUrl,targetId) { 
document.getElementById("tab4").className = "";
document.getElementById("tab5").className = "";
document.getElementById("tab"+tab).className = "active";

makeRequest('action=getAds&type='+type,targetId,siteUrl);
}

function setDefatutCity(passId)
{
	//alert(passId);
	if(document.getElementById('myCity').checked){
		if(confirm('Are you Sure? You want to set this City as Default City')){
			window.location=passId;
		}else{
			document.getElementById('myCity').checked = false;
		}
	}
}

function openPopUp(url){
 	window.open(url,"mywin","menubar=0,resizable=1,width=850,height=400,scrollbars=yes");
}

function updateTxt()
{
	try
	{
		updateText();
	}
	catch(e)
	{
		return;
	}
}
