var IE = document.all?true:false;

function Setfocus(){
    window.scrollTo(0,0);
    //document.documentbody.scrollTo(0,0);
    }

function clearSearchCriteria(){
   document.getElementById("ctl00_MainContent_hdnCharIndex").value="";
   document.getElementById("ctl00_MainContent_hdnpageIndex").value="";
   document.getElementById("ctl00_MainContent_hdnsortby").value="";
   window.scrollTo(0,0);
 }
function executeOnload(){
    /* if (document.getElementById('ctl00$ctlP_welcomeNav$ddlBooth')){
        document.getElementById('ctl00$ctlP_welcomeNav$ddlBooth').className='expandableDropdown';
    } */
    if (document.getElementById('ctl00_pnloverDiv')){
        document.getElementById('ctl00_pnloverDiv').display='none';
    }
    TableRowColorHoverInit();
    reset_eAPanel();
    window.onscroll=FloatLoadingIndicator;    
    trackAnalytics("");
    }
 
function keepup(ev,tdelement,blncalpopup) {
	var cursor = cursorPosition(ev);
    var top 
    if (blncalpopup) top = document.getElementById("ctl00_pnloverDiv");
    else top=document.getElementById("overDiv");
    top.style.position = 'absolute';
    if (!blncalpopup){
    top.style.top = cursor.y+2+'px';
    top.style.left = cursor.x+2+'px'; //+35+ 'px';  
    }
    else{
    top.style.top = cursor.y+1+'px'; //+ 20 + 'px';
    top.style.left = cursor.x+1+'px'; //+35+ 'px';  
    }
    //initialize()  
}

function cursorPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    }else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}


function popup (ev,str,tdelement,varhref){
if (str=='')str="Details not available"; else str="<b><u>Details</u> : </b> "+str;
//    if (document.all) document.getElementById("dvdetail").innerText=str; 
//    else document.getElementById("dvdetail").textContent=str;
    document.getElementById("dvdetail").innerHTML=str; 
	document.getElementById("ahref").href=varhref
	keepup(ev,tdelement,true); 
	document.getElementById("ctl00_pnloverDiv").style.display = '';	
}

function Calpopup (ev,str,tdelement,varhref){
   document.getElementById("overDiv").innerHTML=str; 
   //document.getElementById("ahref").style.display='none'
   keepup(ev,tdelement,false); 
   document.getElementById("overDiv").style.display = '';	
   document.getElementById("overDiv").style.height='auto';
   
}


function resolve(){
	if(document.getElementById("ctl00_pnloverDiv"))document.getElementById("ctl00_pnloverDiv").style.display = 'none';
	if(document.getElementById("overDiv"))document.getElementById("overDiv").style.display = 'none';
}

var intOpacity;
var t;
function initialize(){
	intOpacity=1;
	animate();
}
function animate(){
		document.getElementById("ctl00_pnloverDiv").style.filter="Alpha(Opacity="+intOpacity+")";
		intOpacity=intOpacity+1;
		if (intOpacity<=88) {
			t=setTimeout(animate,1);
		}else {
			clearTimeout(t);
		}
	}
	

function showFeatures(winName, url){
	window.open(url, winName);
	return false;
}

var activeMTab, activeSTab;
var blnPostback=false; blnExecuted=false;
var timeout;

function setActiveTab(){
    if (document.getElementById("dvSubNav")){
    var dvSubNav = document.getElementById("dvSubNav");
    for (var elCount=0;elCount<dvSubNav.getElementsByTagName("A").length;elCount++){
        if (dvSubNav.getElementsByTagName("A")[elCount].className=="dvSubNavspanaActive") {
            activeSTab = elCount;
            break;
        }
    }
    }
    var dvMainnav = document.getElementById("dvMainnav");
    for (var elCount=0;elCount<dvMainnav.getElementsByTagName("A").length;elCount++){
        if (dvMainnav.getElementsByTagName("A")[elCount].className=="dvMainnavspanaActive") {
            activeMTab = dvMainnav.getElementsByTagName("A")[elCount];
            break;
        }
    }
}

function returnActive(vlogin){
    if (activeMTab){
        blnExecuted=true;
        createSubmenus(activeMTab,vlogin); 
        activeMTab.className="dvMainnavspanaActive";
        highlightSubmenus();
        if (document.getElementById("dvSubNav")){
        document.getElementById("dvSubNav").getElementsByTagName("A")[activeSTab].className="dvSubNavspanaActive";
        }
        blnExecuted=false;            
    }
}

function handleTimeout(vlogin){
    if (blnPostback==false) {
        setActiveTab();
        blnPostback = true;                
    }
    if (blnExecuted==false) {
        clearTimeout(timeout);
        timeout=setTimeout(function (){returnActive(vlogin)},5000);
    }
}

function highlightSubmenus(ATag,varLogin){  
    handleTimeout(varLogin);
    if (document.getElementById("dvSubNav")){
    var dvSubNav = document.getElementById("dvSubNav");
    for (var elCount=0;elCount<dvSubNav.getElementsByTagName("A").length;elCount++){
        dvSubNav.getElementsByTagName("A")[elCount].className="";
    }
    }
    if (ATag) ATag.className="dvSubNavspanahover";
}

function createSubmenus(ATag,varLogin){
    handleTimeout(varLogin);
    if (window.ActiveXObject){
        transformXML_IE(ATag.nameProp,varLogin);
    }else if (document.implementation && document.implementation.createDocument){
        transformXML_NonIE(ATag.href,varLogin);
    }
    
    var dvMainnav = document.getElementById("dvMainnav");
    for (var elCount=0;elCount<dvMainnav.getElementsByTagName("A").length;elCount++){
        dvMainnav.getElementsByTagName("A")[elCount].className="";
    }
    ATag.className="dvMainnavspanahover";    
}

var xmldoc,xsldoc;
function transformXML_IE(pname,plogin){
    if(!xmldoc || !xsldoc){
        xmldoc = new ActiveXObject("Microsoft.XMLDOM"); 
        xmldoc.async = false;                     
        xsldoc = new ActiveXObject("Microsoft.XMLDOM"); 
        xsldoc.async = false;
        xmldoc.load("../include/XSLT/NetzoneMenu.xml"); 
        xsldoc.load("../include/XSLT/NetzoneMenu.xsl");
    }
    xsldoc.getElementsByTagName("xsl:param")[0].nodeTypedValue = plogin;    
    xsldoc.getElementsByTagName("xsl:param")[1].nodeTypedValue = pname;
    xsldoc.getElementsByTagName("xsl:param")[2].nodeTypedValue = "1";
    if (document.getElementById("dvSubNav")){
    document.getElementById("dvSubNav").innerHTML = xmldoc.transformNode(xsldoc);    
}
}

var xsltProcessor,xmlSource;
function transformXML_NonIE(pname,plogin){
    if(!xsltProcessor || !xmlSource){
        var xslStylesheet,xmlSource;
        var xsltProcessor = new XSLTProcessor();
        var xmlRequest;
        
        xmlRequest = new XMLHttpRequest();
        xmlRequest.open("GET", "../include/XSLT/NetzoneMenu.xsl", false);
        xmlRequest.send(null);        
        xslStylesheet = xmlRequest.responseXML;
        xsltProcessor.importStylesheet(xslStylesheet);
        
        xmlRequest = new XMLHttpRequest();
        xmlRequest.open("GET", "../include/XSLT/NetzoneMenu.xml", false);
        xmlRequest.send(null);
        xmlSource = xmlRequest.responseXML;
    }
    pname = pname.substring(pname.lastIndexOf("/")+1,pname.length);
    xsltProcessor.setParameter(null,"LoginMode",plogin);    
    xsltProcessor.setParameter(null,"CurrentPage",pname);    
    xsltProcessor.setParameter(null,"JScript","1");    
    if (document.getElementById("dvSubNav")){
    document.getElementById("dvSubNav").innerHTML="";
    document.getElementById("dvSubNav").appendChild(xsltProcessor.transformToFragment(xmlSource, document));            
}
}

function expandState(ctlstate){
    var extender=$find(ctlstate);
    extender._doOpen();
}
function collapseState(ctlstate){
    var extender=$find(ctlstate);
    extender._doClose();
}
function OpenModal(varCOID,varBoothID){
var extender=$find('ctl00_MainContent_MPE1');
  extender.show();
  document.getElementById("ctl00_MainContent_txtComment").focus();
  document.getElementById("ctl00_MainContent_hdnTask").value="SendMail"+"__"+varCOID+"__"+varBoothID;
  return false;
}
function OpenModalDialog(URL,varCOID,varBoothID){
  sFeatures="height=400px,width=422px,resizable=0,status=0,toolbar=0,menubar=0,statusbar=0"
  var mywindow=window.open(URL, "SendMail",  sFeatures)
  mywindow.focus();
  return false;
}

function OpenModalAttSrch(varContactID){
//sarvesh
var extender=$find('ctl00_MainContent_MPE1');
  extender.show();
  document.getElementById("ctl00_MainContent_txtComment").focus();
  document.getElementById("ctl00_MainContent_hdnTask").value="SendMail"+"__"+varContactID;
  return false;
}
function hideModal(ev){
    if (!ev) ev = event.keyCode;  
    if (ev.keyCode==27) {            
        window.close();
    }  
}
var paneindex
function ExpandAccordian(id){
    if (id!=undefined && (id>0 && id<=2)) paneindex=id;
    var t;
    t = setTimeout(ExpandAccordian,500);
    if ($find("ctl00_LeftNav_MyAccordion_AccordionExtender")){
        clearTimeout(t);
        var behavior =$find("ctl00_LeftNav_MyAccordion_AccordionExtender");
        behavior.set_SelectedIndex(paneindex);
    }
}

function showAnimation(ev,tdelement,companyName,Boothlabel,Profile,varurl){
    if (!document.getElementById("dvdetail")) return;
    if (Profile=='') Profile='N/A'; else Profile=Profile+'...';
    document.getElementById("dvdetail").innerHTML="<div style='width:100%;background-color:#F7BF33;color: #4C721D; font-weight: bold'><span>"+companyName+" - Booth: "+Boothlabel+"</span></div><div style='padding-left:3px;'><span>"+Profile+"</span></div>"
//  document.getElementById("dvdetail").innerHTML="<b><u>"+companyName+" (Booth: "+Boothlabel+")</u></b><br/><b>Profile :</b>"+Profile+"..."
    document.getElementById("ahref").href =varurl;
    keepup(ev,tdelement,true); 
    document.getElementById("ctl00_pnloverDiv").style.display = '';	
    return false;
   
}

function showAnimationAttSrch(ev,tdelement,ContactTitle,ContactID,ContactCO,Profile,URL){
//Sarvesh
    if (Profile=='') Profile='N/A'; else Profile=Profile+'...';
    document.getElementById("dvdetail").innerHTML="<div style='width:100%;background-color:#F7BF33;color: #4C721D; font-weight: bold'><span>" + ContactTitle + " (" + ContactCO + ")</span></div><div style='padding-left:3px;'><span>"+Profile+"</span></div>"
    //document.getElementById("dvdetail").innerHTML="<table><tr><th style='width:300px'>" +  ContactTitle + " (" + ContactCO + ")</th></tr><tr><td>"+Profile+"</td></tr></table>"
    document.getElementById("ahref").href =URL;
    keepup(ev,tdelement,true); 
    document.getElementById("ctl00_pnloverDiv").style.display = '';	
    return false;
   }
   
   
  function Cover(bottom,top,ignoreSize) {
  //bottom=bottom.id
  ignoreSize=true;
    var location = Sys.UI.DomElement.getLocation(bottom);
    var top = document.getElementById("info");
    top.style.position = 'absolute';
    top.style.top = location.y + 25 + 'px';
    top.style.left = location.x +35+ 'px';
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
    }
}
            
function SendMail() {
   if(document.getElementById("ctl00_MainContent_txtComment").value!=""){
        __doPostBack("ctl00_MainContent_lnkSortby","");
        document.getElementById("ctl00_MainContent_txtComment").value="";
        }else
        {
            var extender=$find('ctl00_MainContent_MPE1');
            extender.show();
            return false;
        }
        
}
function SearchByCriteria(varparam){
    document.getElementById("ctl00_MainContent_hdnminRank").value="";
    document.getElementById("ctl00_MainContent_hdnMaxRank").value="";
    document.getElementById("ctl00_MainContent_hdnTask").value="";
    if (varparam!='')return confirm(varparam);
   }
function CancelSendMail(){
    document.getElementById("ctl00_MainContent_hdnTask").value="";
     document.getElementById("ctl00_MainContent_txtComment").value="";
    return false;
}


function showExhpopup(ev,companyName,Boothlabel,URL,Profile){  
    document.getElementById("divprofile").innerHTML="<font color=black><b>Profile:"+Profile+"...</b></font>"
    document.getElementById("popoupdiv").innerHTML="<b>"+companyName+" (Booth: "+Boothlabel+")</b>"
    document.getElementById("overDiv").style.display=""
    document.getElementById("ctl00_MainContent_P_SeachResults1_lnkpopup").href =URL;
}

function GoToPage(pageIndex,ctlHidden,PageValue,ctlpostback){	    	
    if(PageValue=='PP'){
    document.getElementById(ctlHidden).value =(parseInt(pageIndex)-1);
    }else if(PageValue=='PN'){
    document.getElementById(ctlHidden).value =(parseInt(pageIndex)+1);
    }else if(PageValue=='PG'){
    document.getElementById(ctlHidden).value =(parseInt(pageIndex));
    }
    Setfocus();
     __doPostBack(ctlpostback,"");
}
	
function SortData(Sortvalue,ctlpostback,ctlHidden){		

    document.getElementById(ctlHidden).value=Sortvalue;
    __doPostBack(ctlpostback,"");
}

function SetCheckBoxSelect(intBoothID,eleCheckbox){
    var Ischecked=0;
    if (eleCheckbox.checked) 
    Ischecked = 0;
    else
    Ischecked = 1;
    document.getElementById("ctl00_MainContent_hdnTask").value="UpdateExpoPln__"+Ischecked;
    document.getElementById("ctl00_MainContent_hdnBoothids").value=intBoothID;
    __doPostBack("ctl00_MainContent_lnkSortby","");
}

function SetCheckBoxSelectAttSrch(intContactID,eleCheckbox){
//sarvesh   
    var Ischecked=0;
    if (eleCheckbox.checked) 
    Ischecked = 0;
    else
    Ischecked = 1;
    document.getElementById("ctl00_MainContent_hdnTask").value="UpdateMyFavorite__"+Ischecked;
    document.getElementById("ctl00_MainContent_hdnContactID").value=intContactID;
    //document.getElementById("ctl00_MainContent_hdnEventID").value=intEventID;
    //document.getElementById("ctl00_MainContent_hdnControlID").value=eleCheckbox.id;
    
       __doPostBack("ctl00_MainContent_lnkSortby",eleCheckbox.id);
}

function OpenAppointMentForm(url){
    var mywin = window.open(url, 'AppointmentRequest' ,'width=750,height=500,left=200,top=100,scrollbars=yes,resizable=yes');
    mywin.focus();
    return false;
}

 function SearchSubmit(lnkExhIndex,lnkSortBy,blnUpdate,pagingQuery)
    {    document.getElementById("ctl00_MainContent_hdnCharIndex").value=lnkExhIndex;
         document.getElementById("ctl00_MainContent_hdnpageIndex").value="1";
	    __doPostBack("ctl00_MainContent_lnkSortby","");
	    return false;
	    
    }
    
function getRelevance(varMinrank,varMaxRank){
    document.getElementById("ctl00_MainContent_hdnminRank").value=varMinrank;
    document.getElementById("ctl00_MainContent_hdnMaxRank").value=varMaxRank;
    document.getElementById("ctl00_MainContent_hdnTask").value='Relevance';
	document.getElementById("ctl00_MainContent_hdnpageIndex").value="1";
    __doPostBack("ctl00_MainContent_lnkSortby","ByRelevance");
    
}
    
 
    //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Abhay Java Scripts [Start]>>>>>>>>>>>>>>>>>>>>>>>>>>
    
       
function showimg(selindx){
    if (selindx=="0"){
        document.getElementById("imgbasic").style.display='none';
        document.getElementById("imgadv").style.display='';
        }
    else
    {
        document.getElementById("imgadv").style.display='none';
        document.getElementById("imgbasic").style.display='';
    }
 }
 
 
 function callbackSessionSearch(varId,varName){

     document.getElementById("ctl00_MainContent_hdnSelectedId").value=varId
     document.getElementById("ctl00_MainContent_hdnSelectedType").value=varName
     Setfocus();
    __doPostBack("ctl00_MainContent_lnkSortby","");
    
}

function getSessionByRelevance(varMinrank,varMaxRank){
    document.getElementById("ctl00_MainContent_hdnminRank").value=varMinrank;
    document.getElementById("ctl00_MainContent_hdnMaxRank").value=varMaxRank;
    document.getElementById("ctl00_MainContent_hdnTask").value='Relevance'
    __doPostBack("ctl00_MainContent_lnkSortby","");
    
}

    

function showAnimationForSession(ev,tdelement,SessionTitle1,SessionDesc,varurl){
    if (SessionDesc=='') SessionDesc='N/A'; else SessionDesc=SessionDesc+'...';
    document.getElementById("dvdetail").innerHTML="<div style='width:100%;background-color:#F7BF33;color: #4C721D; font-weight: bold'><span>"+SessionTitle1+"</span></div><div style='padding-left:3px;'><span>"+SessionDesc+"</span></div>"
    //document.getElementById("dvdetail").innerHTML="<table><tr><th style='width:300px'>" + SessionTitle1 +"<br/></th></tr><tr><td>" + SessionDesc + "</td></tr></table>"
    document.getElementById("ahref").href =varurl;
    keepup(ev,tdelement,true); 
    document.getElementById("ctl00_pnloverDiv").style.display = '';	
    return false;
   
}

function showPopupFavoriteAttendee(ev,tdelement,ContactCompany,Profile,varurl){
if (Profile=='') Profile='N/A'; else Profile=Profile+'...';
    document.getElementById("dvdetail").innerHTML="<div style='width:100%;background-color:#F7BF33;color: #4C721D; font-weight: bold'><span>"+ContactCompany+"</span></div><div style='padding-left:3px;'><span>"+Profile+"</span></div>"
    //document.getElementById("dvdetail").innerHTML="<table><tr><th style='width:300px'>" + ContactCompany + "<br></th></tr><tr><td>" + Profile + "...</td></tr></table>"
    document.getElementById("ahref").href =varurl;
    keepup(ev,tdelement,true); 
    document.getElementById("ctl00_pnloverDiv").style.display = '';	
    return false;
   
}

function AddtoMyItinerary(varSessID,sesCheckBox){
    var Ischecked=0;
    if (sesCheckBox.checked)
        Ischecked=0;
    else
        Ischecked=1;
        document.getElementById("ctl00_MainContent_hdnTask").value="UpdateItinerary__"+Ischecked
        document.getElementById("ctl00_MainContent_hdnSessionId").value=varSessID;
        __doPostBack("ctl00_MainContent_lnkSortby",sesCheckBox.id); 
           
}


function ModifyMyItinerary(varSessID,sesCheckBox,updmsg){
    var Ischecked=0;
    if (sesCheckBox.checked)
        Ischecked=0;
    else
        Ischecked=1;
    var chk=confirm(updmsg);
    if(chk){        
            document.getElementById("ctl00_MainContent_hdnTask").value="UpdateItinerary__"+Ischecked
            document.getElementById("ctl00_MainContent_hdnSessionId").value=varSessID;
            //Setfocus();
            __doPostBack("ctl00_MainContent_lnkSortby",""); 
           }        
    else    
        {  
         sesCheckBox.checked=true
         return false;
        }
}


function UpdateExpoPlan(intBoothID,eleCheckbox,updmsg){
    var Ischecked=0;
    if (eleCheckbox.checked) 
        Ischecked = 0;
    else
        Ischecked = 1;
    var chk=confirm(updmsg);
    if(chk){ 
            document.getElementById("ctl00_MainContent_hdnTask").value="UpdateExpoPln__"+Ischecked;
            document.getElementById("ctl00_MainContent_hdnBoothids").value=intBoothID;
            //Setfocus();
            __doPostBack("ctl00_MainContent_lnkSortby","");
           } 
     else    
        {  
         eleCheckbox.checked=true;
         return false;
        }
}


function SaveAgent(chkmsg){
    var chk=confirm(chkmsg);
    if(chk){
            document.getElementById("ctl00_MainContent_hdnminRank").value="";
            document.getElementById("ctl00_MainContent_hdnMaxRank").value="";
            document.getElementById("ctl00_MainContent_hdnTask").value="";
           }
    else{
        return false;
        }

}

   
    function EnableDisableControl(ControlId,Disable)
{
    var ctrl = document.getElementById(ControlId)
    if (ctrl !=  null)    
    ctrl.disabled = Disable    
}

function Changecontent(index,lmode,role)
{
document.getElementById("ctl00_MainContent_hdnsearchparam").value=index
__doPostBack("ctl00_MainContent_lnkcallback","");
}

//e_myprofile.aspx


function ValidateMaxCategory(source ,arguments)
	{
	    var trErrorMsg = document.getElementById('catmsg');
	    var aReturn=document.getElementsByTagName("Input");
		var Max = document.getElementById('ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_hdnMaxCat').value;
	
		
		var countCheckBoxes=0;
		countCheckBoxes=GetCheckboxSelectedCount();		
		if (countCheckBoxes > Max)
		{
    		if (trErrorMsg !=null) trErrorMsg.style.display='';
			arguments.IsValid = false;
		
		}
	}
function ValidateMinCategory(source ,arguments)
	{ 
	    var trErrorMsg = document.getElementById('catmsg');
		var aReturn=document.getElementsByTagName("Input");
	
	   
		var Min=1;
		var countCheckBoxes=0;
		countCheckBoxes=GetCheckboxSelectedCount();		
		if (countCheckBoxes < Min)
		{
		
	
	        if (trErrorMsg !=null) trErrorMsg.style.display='';
            arguments.IsValid=false;
            
			
             
		}
		
	}
function ValidateMandatoryListItems(source,args){     
		var argValue = true;
		for(var i=0; i<=ListItemIDs.length-1; i++){
			if(IsListItemSelected(ListItemIDs[i])==false){
				var temp = document.getElementById(ErrorMessageLabelIDs[i]);
				if(temp!=null){
					temp.style.display='';
					argValue = false;
				}
			}
		}
		args.IsValid= argValue;
	}
	//Added By sneha for Issue #21985[Start]
function ValidateCheckRadio(source,args){   
	var arrList = source.parentNode.getElementsByTagName('input');
	var blnItemSelected = false;
	
	for (var intIndex = 0;intIndex < arrList.length;intIndex++){
	    if (!arrList[intIndex] || !arrList[intIndex].type) continue;
	    
	    if ((arrList[intIndex].type == 'checkbox' || arrList[intIndex].type == 'radio')
	         && arrList[intIndex].checked){
	         
	         blnItemSelected = true;
	         break;
	    }
	}
	////Added By sneha for Issue #21985
	
	args.IsValid= blnItemSelected;
}   //Added By sneha for Issue #21985[End]
	
function IsListItemSelected(objID){
		var IsChecked = false;
		var obj = document.getElementById(objID);
		if(obj==null){return true;}
		var elements = obj.getElementsByTagName("INPUT");
		for(var i=0; i<=elements.length-1; i++){
			if(elements[i].type!=null){
				//alert(obj.all[i].type);
				if((elements[i].type=='checkbox' || elements[i].type=='radio') && elements[i].checked==true){
					//alert(obj.all[i].checked);
					return true;
				}
			}
		}
		return false;
	}
	
function HideErrorMessages() {  
    if (ErrorMessageLabelIDs!=null) {         
        for(var i=0;i<=ErrorMessageLabelIDs.length-1;i++) {
            var temp = document.getElementById(ErrorMessageLabelIDs[i]); 
            if (temp != null) {
                temp.style.display='none'; 
            }
        }
    }
}


function GetCheckboxSelectedCount()
	{
	    var strId = new String;
		var aReturn=document.getElementsByTagName("Input");
		var i=0;
		var countCheckBoxes = 0;
		for(i = 0;i <= aReturn.length - 1;i++)
		{
		    strId = aReturn[i].id		    
			if (aReturn[i].type == "checkbox" && strId.indexOf("P_ExporterInfo1")<0) 
			{
				if(aReturn[i].checked == true)
				{
					//if(aReturn[i].id.toUpperCase() =="CHECKPRIMARYADDRESS")
					if(aReturn[i].id =="ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_checkPrimaryAddress")
					{
					
					}
					else
					{
						countCheckBoxes++;
					}
					
				}
	    	}
		}
		return countCheckBoxes;
	}
	

	
	function isLetter(c)
	{   
		var letters = /^[a-zA-Z]$/
    	if(c.length > 1) 
			return false
		else
		{
			var matchArray = c.match ( letters ) ;
			if (matchArray == null )
				return false ;
			else
				return true ;
		}
			}
	
	function ValidateHTML(strValue)
	{
					
		var index;
		var arrHtmlArray=new Array(75);
		var blnErr=false;
		var str=strValue;
					
		arrHtmlArray[0]="<br>";
		arrHtmlArray[1]="<p>";
		arrHtmlArray[2]="<head>";
		arrHtmlArray[3]="<body>";
		arrHtmlArray[4]="<IMG>";
		arrHtmlArray[5]="<table>";
		arrHtmlArray[6]="<tr>";
		arrHtmlArray[7]="<td>";
		arrHtmlArray[8]="<font>";
		arrHtmlArray[8]="<ADDRESS>";
		arrHtmlArray[9]="<APPLET>";
		arrHtmlArray[10]="<AREA>";
		arrHtmlArray[11]="<A>";
		arrHtmlArray[12]="<BASE>";
		arrHtmlArray[13]="<BASEFONT>";
		arrHtmlArray[14]="<BIG>";
		arrHtmlArray[15]="<BLOCKQUOTE>";
		arrHtmlArray[16]="<BODY>";
		arrHtmlArray[17]="<BR>";
		arrHtmlArray[18]="<B>";
		arrHtmlArray[19]="<CAPTION>";
		arrHtmlArray[20]="<CENTER>";
		arrHtmlArray[21]="<ADDRESS>";
		arrHtmlArray[22]="<CITE>";
		arrHtmlArray[23]="<CODE>";
		arrHtmlArray[24]="<DD>";
		arrHtmlArray[25]="<DFN>";
		arrHtmlArray[26]="<DIR>";
		arrHtmlArray[27]="<DIV>";
		arrHtmlArray[28]="<DL>";
		arrHtmlArray[29]="<DT>";
		arrHtmlArray[30]="<EM>";
		arrHtmlArray[31]="<FONT>";
		arrHtmlArray[33]="<H1>";
		arrHtmlArray[34]="<H2>";
		arrHtmlArray[35]="<H3>";
		arrHtmlArray[36]="<H4>";
		arrHtmlArray[37]="<H5>";
		arrHtmlArray[38]="<H6>";
		arrHtmlArray[39]="<HEAD>";
		arrHtmlArray[40]="<HR>";
		arrHtmlArray[41]="<HTML>";
		arrHtmlArray[42]="<IMG>";
		arrHtmlArray[43]="<INPUT>";
		arrHtmlArray[44]="<ISINDEX>";
		arrHtmlArray[45]="<I>";
		arrHtmlArray[46]="<KBD>";
		arrHtmlArray[47]="<LINK>";
		arrHtmlArray[48]="<LI>";
		arrHtmlArray[49]="<MAP>";
		arrHtmlArray[50]="<MENU>";
		arrHtmlArray[51]="<META>";
		arrHtmlArray[52]="<OL>";
		arrHtmlArray[53]="<OPTION>";
		arrHtmlArray[54]="<PARAM>";
		arrHtmlArray[55]="<PRE>";
		arrHtmlArray[56]="<P>";
		arrHtmlArray[57]="<SAMP>";					
		arrHtmlArray[58]="<SCRIPT>";
		arrHtmlArray[59]="<SELECT>";
		arrHtmlArray[60]="<SMALL>";
		arrHtmlArray[61]="<STRIKE>";
		arrHtmlArray[62]="<STRONG>";
		arrHtmlArray[63]="<STYLE>";
		arrHtmlArray[64]="<SUB>";
		arrHtmlArray[65]="<SUP>";
		arrHtmlArray[66]="<TD>";
		arrHtmlArray[67]="<TEXTAREA>";
		arrHtmlArray[68]="<TH>";
		arrHtmlArray[69]="<TITLE>";
		arrHtmlArray[70]="<TR>";
		arrHtmlArray[71]="<TT>";
		arrHtmlArray[72]="<UL>";
		arrHtmlArray[73]="<U>";
		arrHtmlArray[74]="<VAR>";
			
		for (i=0;i<74;++i)
		{
			index=str.indexOf(arrHtmlArray[i])
			if (index>=0 )
			{
				blnErr=true;
				break;
			}
		}
					
		index=str.indexOf("<")
		if (index>=0 )
		{
			if ((str.charAt(index+1) != " ") && (isLetter(str.charAt(index+1))))
			{
				blnErr=true;
			}
		}
		
		return blnErr;
	}
	

	function ValidateLimitedHTML(strValue)
	{
					
		var index;
		var arrHtmlArray=new Array(1);
		var blnErr=false;
		var str=strValue;
					
		arrHtmlArray[0]="<A>";
		arrHtmlArray[1]="<IMG>";
			
		for (i=0;i<1;++i)
		{
			index=str.indexOf(arrHtmlArray[i])
			if (index>=0 )
			{
				blnErr=true;
				break;
			}
		}
					
	
		str=str.toUpperCase();
		if(str.indexOf("<IMG")>=0 || str.indexOf("<A")>=0)
		{			
			blnErr=true;
		}
		return blnErr;
	}


	
	function ValidateHTMLBoothPrintProfile(source ,arguments)
	{
		var obj=document.getElementById("ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_TextAreaBoothPrintProfile");	
		var str=obj.value;
		var blnResult;
		blnResult=ValidateHTML(str);
		if(blnResult==true)
		{
			arguments.IsValid = false;
		}
			
	}
	
	function ValidateHTMLCompanyDescription(source ,arguments)
	{
		var obj=document.getElementById("ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_TextAreaBoothProfile");
		var str=obj.value;
		var blnResult;
		blnResult=ValidateLimitedHTML(str);
		if(blnResult==true)
		{
			arguments.IsValid = false;
		}			
	}

function GetVAls()
    {
   
  
        if (document.getElementById('ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_ctlAddressCountryState_ddlCountry')!=null)
            
            document.getElementById("ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_hdnCountryCode").value =  document.getElementById('ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_ctlAddressCountryState_ddlCountry').value
        else
            
            document.getElementById("ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_hdnCountryCode").value =  document.getElementsByName('ctl00_MainContent_wzrdUSerAgent_ctlMyProfile_ctlAddressCountryState_ddlCountry')[0].value
     
    }

    
//p_contact

function OpenCV(strCV){
	window.open('../Custom/CV/' + strCV);
}

function OpenPhoto(strCV){
	window.open(strCV);
}

function openInsamewindow(winName, url) 
	{
		window.location=url;
		return false;
	}		
	
	
	
function UpdateMyFavorite(varFavAttID,sesCheckBox,varSelectedEventId,updmsg){
    var Ischecked=0;
    if (sesCheckBox.checked)
        Ischecked=0;
    else
        Ischecked=1;                
     var chk=confirm(updmsg);
     if(chk){
            document.getElementById("ctl00_MainContent_ctlFavoriteAttendee_hdnTask").value="UpdateMyFavorite__"+Ischecked
            document.getElementById("ctl00_MainContent_ctlFavoriteAttendee_hdnFavAttendId").value=varFavAttID;
            document.getElementById("ctl00_MainContent_ctlFavoriteAttendee_hdnSelectedEventId").value=varSelectedEventId
            __doPostBack("ctl00_MainContent_ctlFavoriteAttendee_lnkSortby","");
	        }
	 else{
	        sesCheckBox.checked=true;
	        return false;
	      }
	}      		
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Abhay JS ENDS -----Sarvesh JS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


	function WebForm_FireDefaultButton_Overrided(event, target) {
                if (event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea"))) {
                    var defaultButton;
                    if (__nonMSDOMBrowser) {
                        defaultButton = document.getElementById(target);
                    }
                    else {
                        defaultButton = document.all[target];
                    }
                    if (defaultButton && typeof(defaultButton.click) != "undefined") {
                        defaultButton.click();
                        event.cancelBubble = true;
                        if (event.stopPropagation) event.stopPropagation();
                        return false;
                    }
                }
                return true;
    }		
			

	/*************** Common Script for Attendee & Exhibitor ********************/
	
	function setDefaultFocus()
	{
	     var arrInputs = document.getElementsByTagName('INPUT');
	     
	     for ( var i = 0; i < arrInputs.length; i++ ) 
	     {
	         if (arrInputs[i].getAttribute("Type")!="hidden")
	         {
	            arrInputs[i].focus();
	            break;
	         }
	     }
	
	}
	

			function isblank(s)
			{
				for(var i=0; i<s.length; i++) {
					var c = s.charAt(i);
					if ((c != '') && (c != '\n') && (c != '\t')) return false;
					}
					return true;
			}

			function checkemail(s)
			{
				var str = s;
				if(str!="")
				{
					//Commentd By Tusli on 02022005
					//var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
					//Added By Tusli on 02022005
					var filter=/^(\w+(['-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)$/
					
					if (filter.test(str))
						testresults=true
					else
					{
					
						testresults=false
					}
					return (testresults)
				}
			}


/*************** Script for Attendee ********************/
			function verify(f,Message211,Message212,btnNo)
			{
				var msg = "";
				var empty_fields = "";
				var errors = "";	
				var strTemp = ""
								
				for(var i=0; i<f.length; i++) {
					var e = f.elements[i];	
					if (e.name == undefined)
					{
						continue;
					}
					if(btnNo == 1)
					{
						if ((e.name.indexOf('Ecode') == -1 ))
						{
							continue;
						}
					}				
					if(btnNo == 2)
					{
						if ((e.name.indexOf('mailLogin') == -1 ))
						{
							continue;
						}
					}						
					if(btnNo == 3)
					{
						if ((e.name.indexOf('mailLogin') != -1 ) || (e.name.indexOf('Ecode') != -1 ))
						{
							continue;
						}
					}						
					//if ((e.name.indexOf('txtMName') != -1 )  ||  (e.name.indexOf('txtCompany') != -1 ) ||  (e.name.indexOf('txtAdd2') != -1 ) || (e.name.indexOf('txtAdd1') != -1 )  || (e.name.indexOf('ddlCountry') != -1 ) || (e.name.indexOf('Phone') != -1 ) || (e.name.indexOf('Fax') != -1 ))
					//{
					//	continue;
					//}
					
					if ((e.name.indexOf('txtMName') != -1 )  ||  (e.name.indexOf('txtCompany') != -1 ) || (e.name.indexOf('Phone') != -1 ) || (e.name.indexOf('Fax') != -1 ))
					{
						continue;
					}
					
					if (((e.type=="text") || (e.type=="textarea") || (e.type=="password")) && !e.optional) 
					{
						
						if ((e.value==null) || (e.value=="") || isblank(e.value)) 
						{
							strTemp = e.name.replace('ctl00$MainContent$ucAtt$','');
							strTemp = strTemp.replace('mailLogin','mail');
							strTemp = strTemp.replace('txt','');
							empty_fields += "\n" + strTemp;
							continue;
						}
						if (e.name.indexOf('Email') != -1 ){
						//empty_fields += "\n" + "Incorrect Email";
							if (!checkemail(e.value)){
							empty_fields += "\n" + "Incorrect Email";
							}
							continue;
						}
						
						if(e.numeric || (e.min != null) || (e.max != null)) {
							var v = parseFloat(e.value);
							if (isNaN(v) || ((e.min != null) && (v < e.min)) || ((e.max != null) && (v > e.max))) {
								errors += " - The field " + e.name + " must be a number " ;
								if(e.min != null)
									errors += " that is greater than " + e.min ;
								if(e.max != null && e.min != null)
									errors += " and less than " + e.max;
								else if (e.max != null)
									error += " that is less than " + e.max;
								errors += ". \n";
							}
						}
					}
				}
				
				if (!empty_fields && !errors) return true;
				
				//msg += "__________________________________________________";
				//msg += "\n \n";
				//msg += Message212 + " \n"
				//msg += "__________________________________________________";
				//msg += "\n \n";
				
				if (empty_fields) 
				{
				    if (empty_fields != "\n" + "Incorrect Email")
				    {
					msg += Message211 + " \n";
					msg += empty_fields + "\n";
				    }
				else{
				    msg += empty_fields + "\n";
				    }
					if (errors) 
					msg += "\n";
				}
				msg += errors;
				alert(msg);
				return false;
			}			
			
			function Validate(f,Message211,Message212,btnNo)
			{
				var msg = "";
				var Error_Msg = "";
				//For ECode Login 
					
				if (btnNo == 1)
				{
				if ((f.ctl00$MainContent$ucAtt$txtEcode.value==null) || (f.ctl00$MainContent$ucAtt$txtEcode.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtEcode.value))
					{
					Error_Msg += "\n" + "Badge ID ";//Modified By Sneha for Issue#22756
					}
				}
				//For Email and ECode Login 
				if (btnNo == 2)
				{
					if ((f.ctl00$MainContent$ucAtt$txtLogin2ContactEmail.value==null) || (f.ctl00$MainContent$ucAtt$txtLogin2ContactEmail.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtLogin2ContactEmail.value))
					    Error_Msg += "\n" + "Email";
					else if (!checkemail(f.ctl00$MainContent$ucAtt$txtLogin2ContactEmail.value))
					    Error_Msg += "\n" + "Incorrect Email";
					
					if ((f.ctl00$MainContent$ucAtt$txtLogin2ContactECode.value==null) || (f.ctl00$MainContent$ucAtt$txtLogin2ContactECode.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtLogin2ContactECode.value))
					{
					Error_Msg += "\n" + "Badge ID ";//Modified By Sneha for Issue#22756
					}
				}
				
				//For Email Login 
				if (btnNo == 3)
				{
					
					if ((f.ctl00$MainContent$ucAtt$txtLogin3ContactEmail.value==null)  || (f.ctl00$MainContent$ucAtt$txtLogin3ContactEmail.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtLogin3ContactEmail.value))
						Error_Msg += "\n" + "Email";
					else if (!checkemail(f.ctl00$MainContent$ucAtt$txtLogin3ContactEmail.value))
					    Error_Msg += "\n" + "Incorrect Email";
					
				 	
				}
				
				//For COID and ECode Login 
				if (btnNo == 4)
				{
					if ((f.ctl00$MainContent$ucAtt$txtLogin4ContactId.value==null) || (f.ctl00$MainContent$ucAtt$txtLogin4ContactId.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtLogin4ContactId.value))
					{
					Error_Msg += "\n" + "Password ";
					}
					
//					if ((f.ctl00$MainContent$ucAtt$txtLogin4ContactECode.value==null) || (f.ctl00$MainContent$ucAtt$txtLogin4ContactECode.value=="") || isblank(f.ctl00$MainContent$ucAtt$txtLogin4ContactECode.value))
//					{
//					Error_Msg += "\n" + "Password ";
//					}
				}
				if (Error_Msg != "")
				{
					//msg += "__________________________________________________";
					//msg += "\n \n";
					//msg += Message212 + " \n"
					//msg += "__________________________________________________";
					//msg += "\n \n";
					if (Error_Msg != "\n" + "Incorrect Email"){
					msg += Message211 + " \n";
					msg += Error_Msg + "\n";
				    }
				else{
				    msg += Error_Msg + "\n";
				    }
					msg += "\n";
					alert(msg);
					return false;	
				}		
				return true;
				
			}		
			//**************ADDED BY GAURAV TO RECTIFY MEMBERID KEYPRESS PROB*************** START
            function onlyNumericsKeyDown(evt){
                            var _ret = true;
				            //alert(window.event.keyCode);
				            //var key = (window.event) ? evt.which : evt.keyCode;
				            var key = (!evt) ? event.keyCode : evt.keyCode;
            				
				            if (key < 46 || key > 57 || key==47)
				            {	
					            _ret= false;
				            }
				            if (key > 7 && key < 10)
				            {
					            _ret= true;
				            }
				            if (key > 95 && key < 106)
				            {
					            _ret= true;
				            }
				            if (key == 190 || key == 110 || key == 189 || key == 109)
				            {
					            _ret= true;
				            }
				            return _ret;
            }
            //**************ADDED BY GAURAV TO RECTIFY MEMBERID KEYPRESS PROB*************** END
		function onlyNumerics(evt) 
			{	
				var _ret = true;
				//alert(window.event.keyCode);
				//var key = (window.event) ? evt.which : evt.keyCode;
				var key = (!evt) ? event.keyCode : evt.keyCode;
				
				if (key < 46 || key > 57 || key==47)
				{	
					_ret= false;
				}
				if (key > 7 && key < 10)
				{
					_ret= true;
				}
				if (key > 95 && key < 106)
				{
					_ret= true;
				}
				if (key == 190 || key == 110 || key == 189 || key == 109)
				{
					_ret= true;
				}
				return _ret;
			
			}	
		
/*************** Script for Exhibitor ********************/	

	

			function verifyExh(f,Message212,Message211,btnNo)
			{
				var msg = "";
				var empty_fields = "";
				var errors = "";
				
				for(var i=0; i<f.length; i++) {
					var e = f.elements[i];
					
					if(btnNo == 1)
					{
						if ((e.name.indexOf('UserID') == -1 ) && (e.name.indexOf('Password') == -1 ))
						{
							continue;
						}
					}				
					if(btnNo == 2)
					{
						if ((e.name.indexOf('BoothNumber') == -1 ))
						{
							continue;
						}
					}	
										
					if (((e.type=="text") || (e.type=="textarea") || (e.type=="password")) && !e.optional) {
						if ((e.value==null) || (e.value=="") || isblank(e.value)) {
						    //empty_fields += "\n		" + e.name.replace("txt","").replace("BoothNumber","EmailAddress").replace("ucExh$","");
							empty_fields += "\n" + e.name.replace("ctl00$MainContent$ucExh$txtBoothNumber",document.getElementById("ctl00_MainContent_ucExh_hdnSendEmail").value).replace("ctl00$MainContent$ucExh$txt","").replace("PasswordBooth","Password");
							continue;
						}
						if (e.name.indexOf('BoothNumber') != -1 && document.getElementById("ctl00_MainContent_ucExh_hdnSendEmail").value != "Booth Number" ){
						
							if (!checkemail(e.value)){
							empty_fields += "\n" + "Incorrect Email";
							}
							continue;
						}
            //Added by Rajesh for Issue#  22355 [Start]
            if ((navigator.userAgent.indexOf('Chrome') > -1) || (navigator.userAgent.indexOf('Safari') > -1)) {
                if (e.min) {
                    if (e.numeric || (e.min != "") || (e.max != "")) {
                        var strvalue = parseFloat(e.value);
                        if (isNaN(v) || ((e.min != "") && (strvalue < e.min)) || ((e.max != "") && (strvalue > e.max))) {
                            errors += " - The field " + e.name + " must be a number ";
                            if (e.min != "")
                                errors += " that is greater than " + e.min;
                            if (e.max != "" && e.min != "")
                                errors += " and less than " + e.max;
                            else if (e.max != "")
                                error += " that is less than " + e.max;
                            errors += ". \n";
                        }
                    }
                }
            }
            else {
						
						if(e.numeric || (e.min != null) || (e.max != null)) {
							var v = parseFloat(e.value);
							if (isNaN(v) || ((e.min != null) && (v < e.min)) || ((e.max != null) && (v > e.max))) {
								errors += " - The field " + e.name + " must be a number " ;
								if(e.min != null)
									errors += " that is greater than " + e.min ;
								if(e.max != null && e.min != null)
									errors += " and less than " + e.max;
								else if (e.max != null)
									error += " that is less than " + e.max;
								errors += ". \n";
							}
						}
					}
            //Added by Rajesh for Issue#  22355 
        }
				}
				
				if (!empty_fields && !errors) return true;
				
				//msg += "__________________________________________________";
				//msg += "\n \n";
				//msg += Message212 + " \n"
				//msg += "__________________________________________________";
				//msg += "\n \n";
				
			    if (empty_fields) 
			    {
				    if (empty_fields != "\n" + "Incorrect Email")
				    {
					    msg += Message211 + " \n";
					    msg += empty_fields + "\n";
				    }
				    else{
				        msg += empty_fields + "\n";
				    }
					if (errors) 
					msg += "\n";
				}
				msg += errors;
				alert(msg);
				return false;
			}			
			
function EmailThisPage(a,vareventname){
   // var content_vlue = document.getElementById("dvEmailContent").innerHTML; 
   // alert(content_vlue);
    //return false;
   // var cont="<html><head><link href='../include/interface.css' rel='stylesheet' type='text/css' />";
    //cont=cont  +" </head><body><form><center>"
   //cont=cont  + content_vlue 
   //cont=cont  + "</center></form></body></html>"
   var strBody = "Check out this page: " + window.location
       document.getElementById(a).href="mailto:?subject="+ vareventname + " networking&body=" + strBody // Modified by Sakshi to implement the event name
    return false;
}

function GetURL(e)
{
   window.location = document.getElementById("ctl00_ctlP_welcomeNav_hdnHome").value;
   
}

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>    SARVESH>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

function validateSelection(objtable,blndopostback){
    for (var intCount=0; intCount<objtable.getElementsByTagName("INPUT").length;intCount++){
	    var ctlElement = objtable.getElementsByTagName("INPUT")[intCount];
		if(ctlElement.type=="checkbox"){
		    if (ctlElement.checked) {
		        if(blndopostback==true)__doPostBack(objtable.id,"");
		        return true;
            }
        }
    }
	return false;
}

function RefreshParentWindow(Msg){
var strloc=window.opener.location.href
var strUrl=(strloc.substring(strloc.lastIndexOf("/")+1,strloc.length)).toUpperCase();
if (strUrl.indexOf('BOOTH.ASPX')>-1 || strUrl.indexOf('SPEAKERDETAILS.ASPX')>-1) {
window.opener.document.forms[0].submit();
}
  var WinConfirm=window.confirm(Msg);
  if (WinConfirm==true) window.close();
}


function isValidCreditCardExpiryDate(source,arguments)
{
    var expdate = document.getElementById("ctl00_MainContent_Ctl_CreditCardinfo_txtExpDateEdit").value;
    var mm;
    var yy;
    var currentmm;
    var currentyear;
    var currentdate=new Date();
    var entereddate=new Date();
    var currentdatemodified=new Date();
  
    if (expdate.length==4)
    {        
        mm=expdate.substring(0,2);
        yy=expdate.substring(2);
        currentmm = currentdate.getMonth();
        currentyear = currentdate.getFullYear();
        entereddate.setFullYear(yy,mm-1,1);
        currentdatemodified.setFullYear(String(currentyear).substring(2), currentmm, 1);
        if (entereddate<currentdatemodified){
            if (arguments) arguments.IsValid = false;
            else return false;
        }
        else{
            arguments.IsValid = true;
        }
    }
    
}


function isValidCreditCard(source,arguments){
    var type
    var typeIndex = document.getElementById("ctl00_MainContent_Ctl_CreditCardinfo_ddlCardType").selectedIndex;
    var ccnum = document.getElementById("ctl00_MainContent_Ctl_CreditCardinfo_txtCardNumberEdit").value;
    if (typeIndex=="0"){
        arguments.IsValid = false;
        return false; 
    }
    if (typeIndex=="1"){
        type="MC"
    }
    else if(typeIndex=="2"){
        type="Visa"
    }
    else if(typeIndex=="4"){
        type="Disc"
    }
    else if(typeIndex=="3"){
        type="AmEx"
    }
    else if(typeIndex=="5"){
        type="Diners"
    }
   if (type == "Visa") {
      var re = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/;
   } 
   else if (type == "MC") {
            var re = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/;
   } 
   else if (type == "Disc") {
            var re = /^6011-?\d{4}-?\d{4}-?\d{4}$/;
   } 
   else if (type == "AmEx") {
        var re = /^3[4,7]\d{13}$/;
   } 
   else if (type == "Diners") {
           var re = /^3[0,6,8]\d{12}$/;
   }
   if (!re.test(ccnum)){
      arguments.IsValid = false;
      return;
   }
   
   ccnum = ccnum.split("-").join("");
   var checksum = 0;
   for (var i=(2-(ccnum.length % 2)); i<=ccnum.length; i+=2) {
      checksum += parseInt(ccnum.charAt(i-1));
   }
   for (var i=(ccnum.length % 2) + 1; i<ccnum.length; i+=2) {
      var digit = parseInt(ccnum.charAt(i-1)) * 2;
      if (digit < 10) { 
            checksum += digit; 
      } 
      else { 
            checksum += (digit-9); 
      }
   }
   if ((checksum % 10) == 0)  
        arguments.IsValid = true; 
   else  
        arguments.IsValid = false;
}

function onlyAlphaNumerics() 
			{	
				var KeyCode = window.event.keyCode;
				if((KeyCode>=48 && KeyCode<=57) ||
				KeyCode==8 || KeyCode==9 ||
				(KeyCode>=96 && KeyCode<=105) || KeyCode==46 ||
				(KeyCode>=37 && KeyCode<=40) || (KeyCode>=65 && KeyCode<=90)){
					return true;
				}
				return false;			
			} 
			

function toggleStatus(s)
  {
  var btnSubmit = document.getElementById("ctl00_MainContent_btnSubmit");
  btnSubmit.disabled =true;
  if (s.checked==true)
  {
    btnSubmit.disabled =false;    
    btnSubmit.focus();
  } 
  }

function onlyNumerics(varInput,ev){
    if (ev.keyCode==13) {
        cmdCheckout = document.getElementById("ctl00_MainContent_cltShoppingCart1_rptShoppingCart_ctl02_cmdCheckout");        
        cmdCheckout.click();
    }
    if (parseInt(String.fromCharCode(ev.keyCode))==0) return true;
    if (parseInt(String.fromCharCode(ev.keyCode))){
        return true;
    }else{
        return false;
    }
}

function cust_onlyNumerics(varInput,ev){
    var charCode = (ev.which) ? ev.which : event.keyCode
    if (charCode==8) return true;
    if (charCode==13) {
        cmdCheckout = document.getElementById("ctl00_MainContent_cltShoppingCart1_rptShoppingCart_ctl02_cmdCheckout");        
        if (cmdCheckout){
        cmdCheckout.click();}
    }
     if (parseInt(String.fromCharCode(charCode))==0) return true;
        if (parseInt(String.fromCharCode(charCode))){
            return true;
        }else{
            return false;
        }
}


function calc_Amount(ObjTextbox){
    var varOld=ObjTextbox.value;
    var _regEx = new RegExp(/\D+/g);
    var varNew=varOld.replace(_regEx,"").replace(/^0+/,"");
    if (varNew=="") ObjTextbox.value="1";
    else if (parseInt(varNew)>0) ObjTextbox.value=varNew;
    else ObjTextbox.value="1";
    __doPostBack('ctl00$MainContent$lnkCallBack','Calculate_Amount');   
}


function PrintReceipt(){
    var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; 
    disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
    var content_vlue = document.getElementById("dvReceipt").innerHTML; 
  
    var docprint=window.open("","",disp_setting); 
    docprint.document.open(); 
    docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
    docprint.document.write('<html><head><link href="../App_Themes/a2zTheme/a2zTheme.css" rel="stylesheet" type="text/css" /><title>Print  Receipt</title>'); 
    docprint.document.write('</head><body onLoad="self.print()"><center>');          
    docprint.document.write('<table style="width:100%"><tr>')
    docprint.document.write('<td align="left" style="width:50%"><a onclick="self.close();">Close this window</a></td>')
    docprint.document.write('<td align="right" style="width:50%"><a onclick="self.print();">Print this page</a></td>')    
    docprint.document.write('</tr><tr><td colspan="2" style="width:100%">')
    docprint.document.write(content_vlue);  
    docprint.document.write('</td></tr></table>')        
    docprint.document.write('</center></body></html>'); 
    docprint.document.close(); 
    docprint.focus(); 
    return false;
}

// Function for the master page loading indicater to come at the center.
function FloatLoadingIndicator(){
    if (document.getElementById("LoadingIndicator")){
        document.getElementById("LoadingIndicator").style.top=document.documentElement.scrollTop+window.screen.availHeight/2;
        document.getElementById("LoadingIndicator").style.left=document.documentElement.scrollLeft+window.screen.availWidth/2;
    }
}

////////////////////////////added by Dharmendra for Phone Fax

function IsNumeric(strString,onlydigits) 	
   {
   var strValidChars = "0123456789x";
   var strChar;
   var blnResult = true;
   
   if (onlydigits == true)
   {
    strValidChars = "0123456789";
   }
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
   
      
function Trim(TRIM_VALUE){
    if(TRIM_VALUE.length < 1){
    return"";
    }
    TRIM_VALUE = RTrim(TRIM_VALUE);
    TRIM_VALUE = LTrim(TRIM_VALUE);
    if(TRIM_VALUE==""){
    return "";
    }
    else{
    return TRIM_VALUE;
    }
} //End Function

function RTrim(VALUE){
    var w_space = String.fromCharCode(32);
    var v_length = VALUE.length;
    var strTemp = "";
    if(v_length < 0){
    return"";
  }
  var iTemp = v_length -1;

    while(iTemp > -1){
    if(VALUE.charAt(iTemp) == w_space){
    }
    else{
    strTemp = VALUE.substring(0,iTemp +1);
    break;
    }
    iTemp = iTemp-1;

    } //End While
    return strTemp;

} //End Function

function LTrim(VALUE){
    var w_space = String.fromCharCode(32);
    if(v_length < 1){
    return"";
    }
    var v_length = VALUE.length;
    var strTemp = "";

    var iTemp = 0;

    while(iTemp < v_length){
    if(VALUE.charAt(iTemp) == w_space){
    }
    else{
    strTemp = VALUE.substring(iTemp,v_length);
    break;
    }
    iTemp = iTemp + 1;
    } //End While
    return strTemp;
}	

function setKeywordFocus(ControlId){
    var t;          
    t = setTimeout(function (){setKeywordFocus(ControlId)},500);
    if ( $get(ControlId).style.display==""){
        try{
            $get(ControlId).focus();
            clearTimeout(t);
        }catch(ex){
        }
    }
}

function createAppt(TimeString,TimeAdd,ctlControlId){
    var vAMPM = TimeString.split(" ")[1];
    var vTimeString = TimeString.split(" ")[0];
    var hour=parseInt(vTimeString.split(":")[0]);
    var minute=parseInt(vTimeString.split(":")[1]);
    if (vAMPM=="PM") hour+=12;
    var today=new Date();
    /////// SETTING START APPOINTMENT TIME ///////
    var vTime=new Date(today.getFullYear(),today.getMonth(),today.getDay(),hour,minute);
    try{
        if (vTime.getMinutes()>9) document.getElementById(ctlControlId+"_txtStartMin").value=vTime.getMinutes();
        else document.getElementById(ctlControlId+"_txtStartMin").value="0"+vTime.getMinutes();
        if (vTime.getHours()>=12) {
            if (vTime.getHours()>12) document.getElementById(ctlControlId+"_ddlStartHr").value=vTime.getHours()-12;
            else document.getElementById(ctlControlId+"_ddlStartHr").value=vTime.getHours();
            document.getElementById(ctlControlId+"_ddlStartAMPM").value="PM";
        }else {
            if (vTime.getHours()>0) document.getElementById(ctlControlId+"_ddlStartHr").value=vTime.getHours();
            else document.getElementById(ctlControlId+"_ddlStartHr").value=vTime.getHours()+12;
            document.getElementById(ctlControlId+"_ddlStartAMPM").value="AM";
        }        
    }catch(ex){}
    /////// SETTING END APPOINTMENT TIME /////////
    vTime.setMinutes(vTime.getMinutes()+TimeAdd);
    try{
        if (vTime.getMinutes()>9) document.getElementById(ctlControlId+"_txtEndMin").value=vTime.getMinutes();
        else document.getElementById(ctlControlId+"_txtEndMin").value="0"+vTime.getMinutes();
        if (vTime.getHours()>=12) {   
            if (vTime.getHours()>12) document.getElementById(ctlControlId+"_ddlEndHr").value=vTime.getHours()-12;
            else document.getElementById(ctlControlId+"_ddlEndHr").value=vTime.getHours();
            document.getElementById(ctlControlId+"_ddlEndAMPM").value="PM";
        }else {
            if (vTime.getHours()>0) document.getElementById(ctlControlId+"_ddlEndHr").value=vTime.getHours();
            else document.getElementById(ctlControlId+"_ddlEndHr").value=vTime.getHours()+12;
            document.getElementById(ctlControlId+"_ddlEndAMPM").value="AM";
        }
        document.getElementById(ctlControlId+"_txtEndMin").focus();
    }catch(ex){}
}

function reset_eAPanel(){
    if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlattendee")){
        var intdvGreatHeight=0, intdvCompListHeight=0, intdvGoodHeight=0, intdvAvgHeight=0;
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvGreatMatches")){
            intdvGreatHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_dvGreatMatches").offsetHeight);
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_topten_exhibitors")){
            intdvCompListHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_topten_exhibitors").offsetHeight);
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvLastMatches")){
            intdvGoodHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_dvLastMatches").offsetHeight);
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvAvgMatches")){
            intdvAvgHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_dvAvgMatches").offsetHeight);
        }
        Array.min = function(array){
            return Math.min.apply(Math,array);
        };
        Array.max = function(array){
            return Math.max.apply(Math,array);
        };
        var arrHeight=new Array();
        arrHeight[0]=intdvGreatHeight;
        arrHeight[1]=intdvCompListHeight;
        arrHeight[2]=intdvGoodHeight;
        arrHeight[3]=intdvAvgHeight;
        var maxHeight = Array.max(arrHeight);
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvGreatMatches")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_dvGreatMatches").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_topten_exhibitors")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_topten_exhibitors").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvLastMatches")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_dvLastMatches").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_dvAvgMatches")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_dvAvgMatches").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_trMymatches")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_trMymatches").style.height=maxHeight+"px";
        }
    }else if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlExhibitor")){    
        var intdvGreatHeight=0, intdvCompListHeight=0, intdvGoodHeight=0;
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlGreatMatches")){
            intdvGreatHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlGreatMatches").offsetHeight);
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlCompanylist")){
            intdvCompListHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlCompanylist").offsetHeight);
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlMatchgraph2")){
            intdvGoodHeight=parseInt(document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlMatchgraph2").offsetHeight);
        }
        Array.min = function(array){
            return Math.min.apply(Math,array);
        };
        Array.max = function(array){
            return Math.max.apply(Math,array);
        };
        var arrHeight=new Array();
        arrHeight[0]=intdvGreatHeight;
        arrHeight[1]=intdvCompListHeight;
        arrHeight[2]=intdvGoodHeight;
        var maxHeight = Array.max(arrHeight);
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlGreatMatches")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlGreatMatches").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlCompanylist")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlCompanylist").style.height=maxHeight+"px";
        }
        if (document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlMatchgraph2")){
            document.getElementById("ctl00_MainContent_ctlAgentMatches_pnlMatchgraph2").style.height=maxHeight+"px";
        }
        if (document.getElementById("dvMymatches")){
            document.getElementById("dvMymatches").style.height=maxHeight+"px";
        }
    }
}

// The following snippet works around a problem where FloatingBehavior
// doesn't allow drops outside the "content area" of the page - where "content
// area" is a little unusual for our sample web pages due to their use of CSS
// for layout.
setBodyHeightToContentHeight();
function setBodyHeightToContentHeight() {
if (document.body)
    document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight)+"px";
}
    
function Closediv(){
   $get('ctl00_MainContent_ucExh_pnlContactEmail').style.display='none';
}

function trackAnalytics(varUrl){
    /*********************** Google Anaytics Snippet **********************/
    if (typeof(_gat)=="undefined") return ;
    var pageTracker = _gat._getTracker("UA-145045-11");
    pageTracker._initData();
    if (varUrl==""){
        pageTracker._trackPageview();    
    }else{
        pageTracker._trackPageview(varUrl);    
    }    
    
    var pageTracker = _gat._getTracker("UA-12358870-1");
    pageTracker._initData();
    if (varUrl==""){
        pageTracker._trackPageview();    
    }else{
        pageTracker._trackPageview(varUrl);    
    }    
    //alert(varUrl);
    /*********************** Google Anaytics Snippet **********************/    
}
