// AJAX FUNCTIONS
function getXmlHttpObject()
{
	var oXmlHttp;
	try
	{
		oXmlHttp = new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	return oXmlHttp;
}

function sendRequestAndGetResponse(sUrl, oElement, sMsg, sErrMsg, sMethod, sParams)
{
	var oXmlHttp = getXmlHttpObject();

	if(typeof(oXmlHttp) == "object")
	{
		oXmlHttp.onreadystatechange = function()
		{
			if(oXmlHttp.readyState == 4)
			{
				if(oXmlHttp.status == 200)
				{
					//prompt("", oXmlHttp.responseText);
					
					oElement.innerHTML = oXmlHttp.responseText;
					
				}
				else
				{
					
					oElement.innerHTML = sErrMsg;
				}

			}
			else
			{
				
				oElement.innerHTML = sMsg;
				
				
			}

		}

		if(sMethod == "POST")
		{
			oXmlHttp.open("POST", sUrl, true);
			oXmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			oXmlHttp.setRequestHeader("Content-length", sParams.length);
			oXmlHttp.setRequestHeader("Connection", "close");
			oXmlHttp.send(sParams);
		}
		else
		{
			oXmlHttp.open("GET", sUrl, true);
			oXmlHttp.send(null);
		}

	} // EO if(oXmlHttp != null)
	else
	{
		oElement.innerHTML = sErrMsg;
	}

} // EO sendRequestAndGetResponse()


//Drop down menu
<!-- hide
        function doit(box) {
          val = box.options[box.selectedIndex].value;
          window.open (val,'_top');
        }
        function pause(box) {
          val = box.options[box.selectedIndex].value;
          window.open (val,'_top');
        }
// end hide -->

var ver='3.0.1D'
var m1=new Object
m1.name='m1'
m1.fnm='submenu-top-nav_m1'
if(!window.lastm||window.lastm<1)lastm=1
m1.v17=null
m1.v17Timeout=''
var maxZ=1000
m1.v18
m1.targetFrame
var docLoaded=false
m1.bIncBorder=true
m1.v29=null
m1.v29Str=''
m1.v55=50
m1.scrollStep=10
m1.fadingSteps=3
m1.itemOverDelay=0
m1.transTLO=0
m1.fixSB=0
m1.v21="."
m1.maxlev=2
m1.v22=0
m1.sepH=10
m1.bHlNL=1
m1.showA=1
m1.bVarWidth=0
m1.bShowDel=50
m1.scrDel=0
m1.v23=170
m1.levelOffset=-1
m1.levelOffsety=2
m1.bord=1
m1.vertSpace=3
m1.sep=1
m1.v19=false
m1.bkv=0
m1.rev=0
m1.shs=0
m1.xOff=0
m1.yOff=9
m1.v20=false
m1.cntFrame=""
m1.menuFrame=""
m1.v24=""
m1.mout=true
m1.iconSize=8
m1.closeDelay=1000
m1.tlmOrigBg="#ffffff" //first frame mouseout color//
m1.tlmOrigCol="Black"
m1.v25=false
m1.v52=false
m1.v60=0
m1.v11=false
m1.v10=0
m1.ppLeftPad=5
m1.v54=0
m1.v01=2
m1.tlmHlBg="#F4F4F4" //first frame mouseover color//
m1.tlmHlCol="white"
m1.borderCol="#0c6774"
m1.menuHorizontal=true
m1.scrollHeight=6
m1.attr=new Array("11px",false,false,"#ffffff","#035a67","#000000","Arial","#F0F8D0","Black","#FEE9A6")

admin2=new Array
(
"Master User","/admin/member.php",0,"",""
,"Master-Subuser","/admin/membersubuser.php",0,"",""
,"Credit Approval","/admin/credit.php",0,"",""
,"Client Ledger","/admin/report_credit.php",0,"",""
)

admin3=new Array
(
"Members","/admin/affiliate_user.php",0,"",""
,"Generate Payment","/admin/affiliate_payment.php",0,"",""
,"Payment Details","/admin/affiliatepage.php",0,"",""
)

admin4=new Array
(
"Check Enquiries (QC)","/admin/checkleads_qc.php",0,"",""
,"Check Junk Enquiries (QC)","/admin/junk.php",0,"",""
,"Edit Enquiries (QC)","/admin/editlead.php",0,"",""
,"Add Enquiries (QC)","/admin/addlead.php",0,"",""

)

admin5=new Array
(
"Website Master","/admin/website.php",0,"",""
,"Website to Subuser","/admin/websitetouser.php",0,"",""
)
admin6=new Array
(
"Credit Matrix (Foreign)","/admin/credit_matrix.php",0,"",""
,"Credit Matrix (Indian)","/admin/credit_matrix2.php",0,"",""
)
admin7=new Array
(
"SMS Alert Subscription","/admin/report_sms.php",0,"",""
//,"Clientwise Credit Usage","/admin/report_clientwise_usage.php",0,"",""
,"Sales (Client Wise)","/admin/report_client.php",0,"",""
,"Sales (Enquiry Wise)","/admin/report_lead.php",0,"",""
,"Generation & Sales (Portal)","/admin/report_gen.php",0,"",""
,"Generation & Sales (Date)","/admin/report_gen_date.php",0,"",""
,"Credit Sales & Revenue","/admin/report_revenue.php",0,"",""
,"Credit Allotment","/admin/report_credit_allotment.php",0,"",""
,"Lost Clients","/admin/report-lost-client.php",0,"",""
,"Client Ledger","/admin/report_credit.php",0,"",""
)


master4=new Array
(
"Buy More Credits","/master/buycredits.php",0,"",""
,"View Credit Details","/master/credits.php",0,"",""
,"Allocate Credits to Users","/master/allocatecredits.php",0,"",""
,"Credit Purchase History","/master/credit-purchase-history.php",0,"",""

)
master5=new Array
(
"View / Edit Profile","/master/profile.php",0,"",""
,"Create / Edit Users","/master/subuser.php",0,"",""
)

cc1=new Array
(
"Master User","/admin/member.php",0,"",""
,"Master-Subuser","/admin/membersubuser.php",0,"",""
,"Client Ledger","/admin/report_credit.php",0,"",""
)

cc2=new Array
(
"Members","/admin/affiliate_user.php",0,"",""
,"Generate Payment","/admin/affiliate_payment.php",0,"",""
,"Payment Details","/admin/affiliatepage.php",0,"",""
)

absPath=""
if(m1.v19&&!m1.v20){
if(window.location.href.lastIndexOf("\\")>window.location.href.lastIndexOf("/")) {sepCh = "\\" ;} else {sepCh = "/" ;}
absPath=window.location.href.substring(0,window.location.href.lastIndexOf(sepCh)+1)}
m1.v61=0
m1.v02=m1.v23
document.write("<style type='text/css'>\n.m1CL0,.m1CL0:link{text-decoration:none;width:100%;color:Black; }\n.m1CL0:visited{color:Black}\n.m1CL0:hover{text-decoration:underline}\n.m1mit{padding-left:15px;padding-right:15px;color:Black; font-family:Arial; font-size:11px; }\n"+"</"+"style>")
document.write("<script language='JavaScript1.2' src='/javascript/menu_dom-top-nav.js'></"+"script>")

//drop down menu end

var prevShowDivId;
//to close the popup
function MM_showHideLayers() { //v9.0

	var i,p,v,obj,args=MM_showHideLayers.arguments;
	var prevShowDivObj;
	for (i=0; i<(args.length-2); i+=3)
	with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) {
		v=args[i+2];
		if (obj.style) {
			obj=obj.style; v=(v=="show")?"visible":(v=="hide")?"hidden":v;
		}
		prevShowDivObj = getElementById(prevShowDivId);
		if (v == "visible" && prevShowDivObj != null) {
			prevShowDivObj.style.visibility = "hidden";
		}
		obj.visibility=v;
		if (v == "visible") {
			prevShowDivId = args[0];
		}
	}

}

function countryupdate(country,countryname)
{
setCookie('country',country,'365',countryname);
location.replace('index.php');
}
function setCookie(c_name,value,expiredays,countryname)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	
	document.cookie='countryname'+ "=" +escape(countryname)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
