    function setFromTo(val,fromval){
        
        if ((val.value=='Closed') || (val.value=='Open24hrs')){
            var from =document.forms["businessListingInfoForm"][fromval];
            var fromtxt = from.options[val.selectedIndex].text;
            from.options[val.selectedIndex].selected=true;
            fromtxt=val.value;
        }
    }
    
    function setTime(val){
    
        var from =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsfrom")];
        var to   = document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsto")];
        var fromtxt = from.options[from.selectedIndex].text;
        var totxt   = to.options[to.selectedIndex].text;

           if (fromtxt =='from' || fromtxt=='Open24hrs'){
                to.options[from.selectedIndex].selected=true;
                totxt = fromtxt;
            }   
            else if (totxt =='from' || totxt=='Open24hrs'){
                from.options[to.selectedIndex].selected=true;
                fromtxt=totxt;
            }        
        
        var indfrom =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsto")].options.selectedIndex;
        if  (val.checked){
            if (val.value=="1"){
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("monFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("monTo")].value   =   totxt; 
            }
            else if(val.value=="2"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("tueFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("tueTo")].value   =   totxt; 
            }
            else if(val.value=="3"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("wedFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("wedTo")].value   =   totxt; 
            }
            else if(val.value=="4"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("thrFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("thrTo")].value   =   totxt; 
            }
            else if(val.value=="5"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("friFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("friTo")].value   =   totxt; 
            }
            else if(val.value=="6"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("satFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("satTo")].value   =   totxt; 
            }
            else if(val.value=="7"){ 
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("sunFrom")].value =   fromtxt ;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("sunTo")].value   =   totxt; 
            }
        }   
        
   }

    function setAllHours()
	{		
        var from =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsfrom")].value;		
        var to   = document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsto")].value;
        var chkinvalid ="false";
        sel = document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("selectedDaysOptions")] ;      
        var objfrom =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsfrom")];
        var objto   = document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("hrsto")];
		var chk=true;
		for( var i=0; i<sel.length; i++ ) 
		{
            if (sel[i].checked)
					chk =false;
		}   		     
		if (chk)
		{
			alert("to update select at least one day");                  
			return false;
		}   
    
		if ((from =='Closed' && to!='Closed') || (from !='Closed' && to=='Closed'))
			chkinvalid ="true"; 
		else 
		if((from =='Open24hrs' && to!='Open24hrs')|| (from!='Open24hrs' && to=='Open24hrs'))
			chkinvalid ="true";             
		if (chkinvalid=="true")
		{
                alert("Please select a valid Hours");
                return false;
        }
        var fromAr = new Array('monFrom','tueFrom','wedFrom','thrFrom','friFrom','satFrom','sunFrom');
        var toAr = new Array('monTo','tueTo','wedTo','thrTo','friTo','satTo','sunTo');  
        var days =  new Array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');                               
		var Str = ""; 
        for( var i=0; i<sel.length; i++ ) 
		{ 
			var fromstr =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;
            if (sel[i].checked)
			{
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value=from;
                document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(toAr[i])].value=to; 
                fromstr =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;            
                sel[i].checked=false;
            }    
			if (document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value=='Closed')
			{
				Str=Str+days[i]+" "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;
				Str=Str+"<br>";
            }
			else if(document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value=='Open24hrs')
			{
				Str=Str+days[i]+" Open for 24 hours";
				Str=Str+"<br>";
            }
            else
			{
				if (sel[i].checked || fromstr.length>0)
				{
					Str=Str+days[i]+" "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;
					Str=Str+" to "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(toAr[i])].value;
					Str=Str+"<br>";
				}    
			}                
        }
        document.getElementById("displayAll").innerHTML=Str;           
     return false;
    }

    function setActualHours(){		
        var chkinvalid ="false";
        sel = document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName("selectedDaysOptions")] ;      
        var fromAr = new Array('monFrom','tueFrom','wedFrom','thrFrom','friFrom','satFrom','sunFrom');
        var toAr = new Array('monTo','tueTo','wedTo','thrTo','friTo','satTo','sunTo');  
        var days =  new Array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');                               
         var Str = ""; 		
        for( var i=0; i<sel.length; i++ ) { 
              var fromstr =document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;

                if (document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value=='Closed'){
                    Str=Str+days[i]+" "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;
                    Str=Str+"<br>";
                }
                else if(document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value=='Open24hrs'){
                    Str=Str+days[i]+" Open for 24 hours";
                    Str=Str+"<br>";
                }
                else{
                    if (fromstr.length>0){
                        Str=Str+days[i]+" "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(fromAr[i])].value;
                        Str=Str+" to "+document.forms[getNetuiTagName("businessListingInfoForm")][getNetuiTagName(toAr[i])].value;
                        Str=Str+"<br>";
                    }    
                }
          sel[i].checked=false;      
        }
        document.getElementById("displayAll").innerHTML=Str;  		        
     return false;
    }
    
    
    function setClearAll(){
        var fromAr = new Array('monFrom','tueFrom','wedFrom','thrFrom','friFrom','satFrom','sunFrom');
        var toAr = new Array('monTo','tueTo','wedTo','thrTo','friTo','satTo','sunTo');  
        
        sel = document.businessListingInfoForm.selectedDaysOptions ;
    
        for( var i=0; i<=6; i++ ){
            sel[i].checked=false;
            document.businessListingInfoForm.fromAr[i].value =   '' ;
            document.businessListingInfoForm.toAr[i].value   =   ''; 
        }
        document.getElementById("displayAll").innerHTML='';     
    }
    
    function setCheckOption(loop){
 
    sel = document.businessListingInfoForm.selectedDaysOptions ;
     for( var i=0; i<=6; i++ ){
            sel[i].checked=false;
        }  
    for( var i=0; i<=loop; i++ ){
            sel[i].checked=true;
        }    
        return false;      
    }
    
    function call_onBlur(elementName,element)
    {
        var myString = element.value
        if (myString.length>0 && myString!='email' ){ 
            myString= myString.substring (0, 1).toUpperCase()+ myString.substring (1, myString.length);
            element.value =myString
          var  elementValue=myString;
            call_Refresh_Preview(elementName,element);
        }
    }
  
  function checkSpecialChars(txtArea){	
            var value = txtArea.value;
            var indVal ="";
            var a = new Array('http://','http:','<a href:','<a href','href:','href','<a','</a>','</a','|');  
            val=0;            
           for (var i=0;i<a.length;i++){
               var value1 = value.toLowerCase();            
               if ( value1.indexOf(a[i])>=0){
                    val =value1.indexOf(a[i]);
                    indVal = "" + value.substring(val,val+a[i].length);
                    value = replaceAll(value,indVal,"");
               }
           }
           if (value.length < txtArea.value.length)
           txtArea.value =value;

           return value;
     }
     
     function replaceAll( str, from, to ) {
        var idx = str.indexOf( from );
        while ( idx > -1 ) {
            str = str.replace( from, to );
            idx = str.indexOf( from );
        }

        return str;
     }
     function checkPipeChars(txtArea){	
           var value = txtArea.value;	
          if ( value.indexOf('|')>=0)
                value = replaceAll(value,"|","");
          if(value.length<txtArea.value.length)
                txtArea.value =value;
           return value;
     }
     function call_Refresh_Preview(elementName,element) {
        var elementValue =element.value;
        if (elementName=='adTitle')
            elementValue =checkSpecialChars(element);
        if (elementName=='url' || elementName=='street' )
            elementValue =checkPipeChars(element);
            
        if (elementName =='changedisplay'){
            
             var a = new Array('adTitle','street','city','state','zip','phoneNumber','email');                
             var StrCol="";
             var StrFont="";
             var StrSize="";
             var StrDisp="";
            
             if (element.alt=='SPCLR'){
                    if (element.checked)
                        StrCol ="red";
                  
                    if (document.getElementById(a[0]))
                        document.getElementById(a[0]).style.color=StrCol;                                      
             }       
             else if(element.alt=='SPITL'){
                     if (element.checked)
                         StrFont ="italic";

                    if (document.getElementById(a[0]))
                        document.getElementById(a[0]).style.fontStyle  = StrFont; 
             }       
             else if(element.alt=='SPSZE'){
                    if(element.checked) 
                        StrSize ="bold";                  
                    if (document.getElementById(a[0]))
                        document.getElementById(a[0]).style.fontWeight = StrSize;                                                                            
             }
             
                  else if(element.alt=='SPPF6'){
                    if(element.checked) 
                    {   document.getElementById('business-info').style.display = "inline";                           
                        document.getElementById('promo').style.display = "inline"; 
                        document.getElementById('logo').style.display = "inline"; 
                         document.getElementById('url-link').style.top= "46px";
                         document.getElementById('buttons').style.top= "66px";
                 }                 
               else
                    {   document.getElementById('business-info').style.display = "none";                          
                        document.getElementById('promo').style.display = "none";
                        document.getElementById('logo').style.display = "none";
                         document.getElementById('url-link').style.top= "20px";
                         document.getElementById('buttons').style.top= "40px";
                 }
        }
        
             else if (element.alt=='SPHLT'){
                   if(element.checked)
                        StrDisp ="#FFFFCC";
                    var highlight = document.getElementById('elpSamplePreview');
                    if(highlight)
                        highlight.style.background = StrDisp;
                    highlight = document.getElementById('elpSamplePreview2'); 
                     if(highlight)
                        highlight.style.background = StrDisp;  
                  
                   if(document.getElementById('adTitle'))
                    {                                 
                   document.getElementById('adTitle').style.background= StrDisp;
             }      
             }              
        }
        else{        		
                if (elementName=='phoneNumber'||  elementName=='email'){
                    if( elementValue.length > 0){                          
                        document.getElementById(elementName+'Link').style.display = "inline";  
                        //$('#'+elementName+'div').show();
                        setAdPreviewDividers(elementName);
                    }     
                    else{
                        document.getElementById(elementName+'Link').style.display = "none"; 
                        document.getElementById(elementName+'Preview').style.display = "none";
                        $('#'+elementName+'div').hide();
                        resetAdPreviewDividers();                     
                    }    
                    if(elementName == 'email')
                    {
                        elementValue = '<u>' + elementValue + '</u>';
                    }                    
                    elementValue = elementValue + '<br/>';
                }                
                if ((elementName=='state'))
                    elementValue =", "+elementValue;
                if ((elementName=='zip'))
                    elementValue ="&nbsp;"+elementValue;
                if (elementName=='street')    
                 elementValue =elementValue+", ";
                
                 if (elementName=='url' ){
                   
                    if (elementValue.length >0)
                        document.getElementById('urlPreview').style.display = "block"; 
                    else
                        document.getElementById('urlPreview').style.display = "none";   
                        
                    elementValue = "<a style='color: #0066CC;text-decoration:none' href=#test>"+elementValue+"</a>";                    
                 }  
               if (elementName=='promotionalText' ){
                   
                    if (elementValue.length >0)
                        document.getElementById(elementName).style.display = "inline"; 
                    else
                        document.getElementById(elementName).style.display = "none"; 

                      elementValue =elementValue+"<br>";
                 }  
                 if(elementName != 'adTitle' && elementName != 'promotionalText')
                    elementName = elementName + 'Preview';
                document.getElementById(elementName).innerHTML = elementValue;                 
        }
            
    }
    function setAdPreviewDividers(gbtn)
    {
    	var emailbtn= $('#emailLink'), phbtn=$('#phoneNumberLink'), moreinfobtn= $('#businessprofilelink');
		if(gbtn=='businessprofile')
		{
			if(phbtn.css('display')!='none' || emailbtn.css('display')!='none')
				$('#businessprofilelinkdiv').show();
		}
		else if(gbtn=='phoneNumber')
		{
			if(moreinfobtn.css('display')!='none')
				$('#businessprofilelinkdiv').show();
			if(emailbtn.css('display')!='none')
				$('#phoneNumberdiv').show();
		}
		else if(gbtn=='email')
		{
			if(phbtn.css('display')!='none')
				$('#phoneNumberdiv').show();
			else if(moreinfobtn.css('display')!='none')
				$('#businessprofilelinkdiv').show();
		}
    }
    function resetAdPreviewDividers()
    {
    	var emailbtn= $('#emailLink'), phbtn=$('#phoneNumberLink'), moreinfobtn= $('#businessprofilelink');
    	if(moreinfobtn.css('display')!='none' && ( phbtn.css('display')!='none' || emailbtn.css('display')!='none') )
    		$('#businessprofilelinkdiv').show();
    	else
    		$('#businessprofilelinkdiv').hide();
    		
    	if(phbtn.css('display')!='none' && emailbtn.css('display')!='none')
				$('#phoneNumberdiv').show();
		else
				$('#phoneNumberdiv').hide();
    }
    function call_display_preview(element) {
 
      var a = new Array('city','state','zip','street');                
      var cnt = a.length;
      var dispStr ="inline";
      
      if (element.value=='HIDE' ){
        cnt = a.length-2;
        document.getElementById(a[cnt]+'Preview').style.display = "none"; 
        document.getElementById(a[cnt+1]+'Preview').style.display = "none"; 
      }
      else if(element.value=='CITY' ){
        cnt = a.length-1;
        document.getElementById(a[cnt]+'Preview').style.display = "none"; 
        if (document.getElementById(a[cnt]+'EH'))
            document.getElementById(a[cnt]+'EH').style.display =  "none";                    
      }        
        for (var i=0;i<cnt;i++){
                    document.getElementById(a[i]+'Preview').style.display = dispStr;  
                    if (document.getElementById(a[i]+'EH'))
                        document.getElementById(a[i]+'EH').style.display =  dispStr;                      
        }                       
    
    
    }
    
	function call_onload_preview(name) 
	{
		var a = new Array('city','state','zip','street');                
		var cnt = a.length;
		var dispStr ="inline";
		
		if (name=='HIDE')
		{
            cnt = a.length-2;
            document.getElementById(a[cnt]+'Preview').style.display = "none"; 
            document.getElementById(a[cnt+1]+'Preview').style.display = "none"; 
		}
		else 
		if(name=='CITY' )
		{
			cnt = a.length-1;
			document.getElementById(a[cnt]+'Preview').style.display = "none"; 
			if (document.getElementById(a[cnt]+'EH'))
				document.getElementById(a[cnt]+'EH').style.display =  "none";                    
		}        
		for (var i=0;i<cnt;i++)
		{
			document.getElementById(a[i]+'Preview').style.display = dispStr;  
			if (document.getElementById(a[i]+'EH'))
				document.getElementById(a[i]+'EH').style.display =  dispStr;                      
		} 		                              
    }

	function openTestProfilePreviewPopup(targetURL) {     
            popWin = window.open(targetURL,"Profile_Preview","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=990, height=700")            
            initPopUpBlockerTimer();
    }
	function openProfilePreviewPopup() {     
            var targetURL='jsp/popups/businessprofile/previewProfile.jsp';        
            popWin = window.open(targetURL,"Profile_Preview","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=490, height=300")            
            initPopUpBlockerTimer();
    }

    function popUpWindow(catId)
    {       
            var targetURL='/pageflows/businessprofile/profilereview/previewAction.do';        
            popWin = window.open(targetURL,"preview_details","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=400, height=400")
            initPopUpBlockerTimer();
    }

    
    function openNewWin(trgtURL)
    {
            var targetURL ='http://';
            if (trgtURL.indexOf('http:')<0 || trgtURL.indexOf('https:')<0 )
                targetURL=targetURL+trgtURL;
            else
                targetURL=trgtURL;
             
            popWin = window.open(targetURL,"Mywebsite",'width=400,height=200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')
            initPopUpBlockerTimer();
    }

    function closeWin(newWindow) 
    {
        newWindow.close(); 
    }
  
    //for categorysel.jsp
    function catChanged(){			
		document.forms[getNetuiTagName("catResultForm")][getNetuiTagName('categoriesChanged')].value = "true";     
    }
    
    function popUpCategoryDetails(catId){ 
        var targetURL='/spweb/pageflows/businessprofile/categories/showCatDetails.do?catId='+catId;        
        popWin = window.open(targetURL,"category_details","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=390, height=235")
        initPopUpBlockerTimer();
    }
	
//*****************Begin findCategories.jsp methods***********************
	  
	  function validateSrchTxt(){
		  var txtbx = document.forms[getNetuiTagName('catSearchForm')][getNetuiTagName('searchText')];		  
			if(txtbx.value==""){
				alert(keywordEnter);				               
				return false;
			}
			
			return true;
		}
		function submitSearchTextFromAnchor(){ 
			if(validateSrchTxt()){        				
				document.forms[getNetuiTagName('catSearchForm')].submit(); 
			}	     
		}
		
		function checkEnter(e){ 
			var characterCode;
			
			if(e && e.which){ 
				e = e;
				characterCode = e.which ;
			}
			else{
				e = event;
				characterCode = e.keyCode; 
			}
			
			if(characterCode == 13){ 
				submitSearchTextFromAnchor(); 
				return false; 
			}
			else{
				return true ;
			}
		
		}
		
//*****************End findCategories.jsp methods***********************
//*****************Begin browseall.jsp methods***********************

	function extraCheck(sel) {
		var elem = sel ;
		var selected = elem.selectedIndex;
		
		if (elem.options[selected].value.substring(0,5) == "extra") {
			elem.selectedIndex = selected - 1;
		}
	}
	function getList(flag, sel){
		extraCheck(sel);
		document.forms[getNetuiTagName("submitLevel")][getNetuiTagName("action")].value=flag;
		document.forms[getNetuiTagName("submitLevel")].submit();            
	}
		
//*****************End browseall.jsp methods***********************	

<!-- Begin: Enhanced Business Profile methods-->

function openLogoSpecPopup()
{       
    var targetURL='/spportal/jsp/popups/businessprofile/logoSpecifications.jsp';        
    popWin = window.open(targetURL,"logo_specification","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=390, height=390")
    initPopUpBlockerTimer();
}

function submitEBPForm(actionVal) {
    document.ebpForm._eventId.value=actionVal;
    var isEbpPurchased = document.ebpForm.ebpPurchased.value;
   
    document.ebpForm.encoding = "multipart/form-data";
    // Only validate logo when EBP is not purchased and the action is other than 'Continue Without'.
    if (isEbpPurchased == "false" && actionVal != 'ContinueWithout') {
        if (!checkLogoFile(actionVal,isEbpPurchased)) {        
            return false;
        }
    }
    if (true) {
        if (actionVal == 'Upload') {
            document.ebpForm.encoding = "multipart/form-data";
        } else {
            //document.forms[getNetuiTagName("ebpForm")].encoding = "application/x-www-form-urlencoded";
        }
        document.ebpForm.submit();
    } else
        return false; 
}

function checkLogoFile(actionVal,isEbpPurchased){

    var uploadFileObj = document.forms["ebpForm"]["logoFile"];
    var proTxt = document.forms["ebpForm"]["promotext"].value;
    var logFil = uploadFileObj.value;
    //var isEbpPurchased = document.forms[getNetuiTagName("ebpForm")][getNetuiTagName("ebpPurchased")].value;
    var isLogoUploaded = document.forms["ebpForm"]["logoUploaded"].value;
        
    if (actionVal == 'Upload') {
        if (!logFil){
            alert ("Please select a Logo File");
            uploadFileObj.focus();
            return false;
        }
    } else if (actionVal == 'AddToOrder' || actionVal == 'UpdateChanges') {
        if (isEbpPurchased == "false") {
            if (actionVal == 'AddToOrder') {
                if (isLogoUploaded == "false" && !proTxt && !logFil){
                    alert ("Please select a Promo Text or Logo File");
                    uploadFileObj.focus();
                    return false;
                } 
            }
        
            if (isLogoUploaded == "false" && logFil) {
                alert ("Please upload a Logo File before add to Order");
                uploadFileObj.focus();
                return false;
            }
        }
    }
    return true;        
}

function getObject(objID)
{
   if (document.all)
   {
      var obj = document.all[objID];
   }
   else if (document.getElementById)
   {
      var obj = document.getElementById(objID);
   }
	return obj;
}

function showObject(objID,link)
{
	var obj = getObject(objID+'Preview');
        
	var rtn = false;
	if (obj != null) {
     	obj.style.display = "inline";
      obj.style.position = "static";
      obj.style.width = "auto";
      obj.style.height = "auto";
      obj.style.overflow = "visible";
		rtn = true;
	}
    link.className = 'clicked';
    
	return rtn;
}

function showObj(objID,link)
{
	var obj = getObject(objID+'EH');
    var objView = getObject(objID+'EHView');
    
    hideObject(objID+'EH');
	var rtn = false;
	if (obj != null) {
     	obj.style.display = "inline";
      obj.style.position = "static";
      obj.style.width = "auto";
      obj.style.height = "auto";
      obj.style.overflow = "visible";
		rtn = true;
	}
	if (objView != null) {
     	objView.style.display = "inline";
      objView.style.position = "static";
      objView.style.width = "auto";
      objView.style.height = "auto";
      objView.style.overflow = "visible";
		rtn = true;
	}

}

function trimString(txt) {
	txt = txt.replace(/\s+$/g, "");
	txt = txt.replace(/^\s+/g, "");
	return txt;
}	
          
<!-- End: Enhanced Business Profile methods-->


//repeat hours from Monday to Friday
function repeatHours()
{
    var toAr = new Array('tueClosed','wedClosed','thrClosed','friClosed');  
    openHour = document.forms["businessListingInfoForm"].elements["mondayOpen"];
    closeHour = document.forms["businessListingInfoForm"].elements["mondayTo"];
     
    var fromtxt = openHour.options[openHour.selectedIndex].text;
    var totxt   = closeHour.options[closeHour.selectedIndex].text;

    if (fromtxt=='Opening time:'){
        alert('please enter a valid from Date for monday');
        return false;
    }    
    else if (totxt=='Closing time:'){
        alert('please enter a valid to Date for monday');
        return false;
    }                     
    
    document.forms["businessListingInfoForm"].elements["tuesdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["tuesdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["wednesdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["wednesdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["thursdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["thursdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["fridayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["fridayTo"].selectedIndex=closeHour.selectedIndex;        


}

//repeat hours from Monday to rest of the days
function repeatHoursAll()
{
    var toAr = new Array('tueClosed','wedClosed','thrClosed','friClosed');  
    openHour = document.forms["businessListingInfoForm"].elements["mondayOpen"];
    closeHour = document.forms["businessListingInfoForm"].elements["mondayTo"];
    isSelected  = document.forms["businessListingInfoForm"].elements["mondayselected"]; 
    if (isSelected!=null){
    	 var ischecked = false;
    	 if (isSelected.checked){
    		 ischecked = true;
    	 }
    		 document.forms["businessListingInfoForm"].elements["tuesdayselected"].checked = ischecked;
    		 document.forms["businessListingInfoForm"].elements["wednesdayselected"].checked = ischecked;
    		 document.forms["businessListingInfoForm"].elements["thursdayselected"].checked = ischecked;
    		 document.forms["businessListingInfoForm"].elements["fridayselected"].checked = ischecked;
    		 document.forms["businessListingInfoForm"].elements["saturdayselected"].checked = ischecked;
    		 document.forms["businessListingInfoForm"].elements["sundayselected"].checked = ischecked;
    		                                                    
    	 
    }
    var fromtxt = openHour.options[openHour.selectedIndex].text;
    var totxt   = closeHour.options[closeHour.selectedIndex].text;

    if (fromtxt=='Opening time:'){
        alert('please enter a valid from Date for monday');
        return false;
    }    
    else if (totxt=='Closing time:'){
        alert('please enter a valid to Date for monday');
        return false;
    }                     
    
    document.forms["businessListingInfoForm"].elements["tuesdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["tuesdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["wednesdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["wednesdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["thursdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["thursdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["fridayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["fridayTo"].selectedIndex=closeHour.selectedIndex; 
    document.forms["businessListingInfoForm"].elements["saturdayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["saturdayTo"].selectedIndex=closeHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["sundayOpen"].selectedIndex=openHour.selectedIndex;
    document.forms["businessListingInfoForm"].elements["sundayTo"].selectedIndex=closeHour.selectedIndex;
}


/*** SEO Javascript ***/


function buttonSubmitCheck() {
    if (buttonClicked == 1){
        return false;
    } else {                
        buttonClicked = 1;
        document.forms[getNetuiTagName("businessListingInfoForm",this)].submit();  
    }
}


/*** Category functions ***/
function submitCatFrm(){
        document.forms[getNetuiTagName('catSearchForm')].submit();        
    }
function setCatval(val){
    document.forms[getNetuiTagName('catSearchForm')][getNetuiTagName('action')].value=val;
}

function quickCatClose(){
    submitSaveCatResults();
}


function submitCatFrm2(){        
    remCat();				
    document.catResultForm.submit();        
}


/*** preview profile ***/
function showform(nr) {
if (document.layers) {
if (document.layers[nr] != null)
document.layers[nr].display = 'block';
} else if (document.all) {
if (document.all[nr] != null)
document.all[nr].style.display = 'block';
} else if (document.getElementById) {
if (document.getElementById(nr) != null)
document.getElementById(nr).style.display = 'block';
}
}
function hideform(nr) {
if (document.layers) {
if (document.layers[nr] != null)
document.layers[nr].display = 'none';
} else if (document.all) {
if (document.all[nr] != null)
document.all[nr].style.display = 'none';
} else if (document.getElementById) {
if (document.getElementById(nr) != null)
document.getElementById(nr).style.display = 'none';
}
}

/*** ProfileInfo2.jsp ***/
function quickProfileInfo2Close(){
    document.ProfileInfoTwoActionForm.action.value='saveAndQuit';
    document.ProfileInfoTwoActionForm.submit();        
}      

/*** fixed fee listing ***/
function submitFixedFeeForm(formState)
{
	document.forms["fixedFeeForm"]["_eventId_findMore"].name="_eventId_"+formState;
	document.fixedFeeForm.submit();
 
}        

function checkFixedFeeNull(){
document.forms[getNetuiTagName("fixedFeeForm",this)].submit();
}


function SubmitFromAnchor(){ 
       if(document.forms[getNetuiTagName("termsAndConditions")][getNetuiTagName("accepted")].checked==true){
            document.forms[getNetuiTagName("termsAndConditions")].submit(); 
       }else{
            alert('You must agree to the Terms and\nConditions, by checking the box, in order to\ncontinue..');
            return; 
       } 
                      
     }
function updateBusinessListing(currentForm,list) {
	for(var i=0; i<list.length; i++)
	{
		
		if(list[i].checked == true)
		{		   
			document.forms["fixedFeeForm"]["_eventId_findMore"].name="_eventId_"+list[i].value;
			document.fixedFeeForm.submit();
		}
	}
}    

function togglebpproductpage(version){
    if(animFlag == false)
    {
        animFlag = true;
	    if(version=="version2")
	        {
	         document.getElementById("customers_version2").style.display= "block";
	         document.getElementById("click_version2").style.display= "block";
	         document.getElementById("customers").style.display= "none";
	         document.getElementById("click").style.display= "none";   
	         
	         $("#sppreview").hide();
	         $("#enhanced-listing").hide();
	         $("#performance-listing").hide();
	         $("#free-listing").hide();	         	        
	         $("#profile_version2").show(1000,
	           function()
	           {
	               animFlag = false;
	           }
	         );
	         
	         $("#freebl").css("height","680px");
	                            
	        }
	    else
	        {
	          $("#profile_version2").hide();                
	          $("#sppreview").show(1000,
	          function()
	          {
		          $("#performance-listing").fadeIn(200); 
		          $("#enhanced-listing").fadeIn(200); 
		          $("#free-listing").fadeIn(200,
		              function()
		              {
		                 animFlag = false;
		              }
		          );
	          });  
	          
	          document.getElementById("customers_version2").style.display= "none";
	          document.getElementById("click_version2").style.display= "none";    
	          document.getElementById("customers").style.display= "block";
	          document.getElementById("click").style.display= "block";
	          
	          $("#freebl").css("height","580px");          
	        }	   
   }
}
function changeBackground(element){
if(element.checked){
    StrDisp ="#FFFFCC";
    document.getElementById('enhanced-results').style.background=" url(/spportal/img-spportal/banners/bpproductpages/enhanced_listing-highlight.gif)";
    document.getElementById('enhanced-results').style.backgroundRepeat='no-repeat';
    document.getElementById('adTitle').style.background= StrDisp;
    document.getElementById('business-info').style.background= StrDisp;
    document.getElementById('url-link').style.background= StrDisp;
  
}
else   {
    StrDisp ="#FFFFFF";                
    document.getElementById('enhanced-results').style.background=" url(/spportal/img-spportal/banners/bpproductpages/enhanced_listing_nobuttons.gif)"  ;     
    document.getElementById('enhanced-results').style.backgroundRepeat='no-repeat';
    document.getElementById('adTitle').style.background= StrDisp;
    document.getElementById('business-info').style.background= StrDisp;
    document.getElementById('url-link').style.background= StrDisp;
}
}

function showVid(box)
{
	if (box.attr('checked'))
		$('#vidicon').show(300);	
	else
		$('#vidicon').hide(300);	
}

//Popup for bp Preview the set up steps
function bpsignupSteps() {
     var targetUrl =  '/spportal/jsp/popups/businessprofile/signupSteps.jsp'
     popWin = window.open(targetUrl, "roi", "width=385,height=460,toolbar=0,status=0");
     initPopUpBlockerTimer();

}

function showreachareas(reach){
 
 if (reach=="city"){
   document.getElementById('cityresults').style.display = 'block';
   document.getElementById('homecountyresults').style.display = 'none';
 }else{
 document.getElementById('homecountyresults').style.display = 'block';
 document.getElementById('cityresults').style.display = 'none'
 }
}

//FF Bundles
function submitFFBundleForm(formState)
{
	document.forms["ffBundleForm"]["_eventId_findMore"].name="_eventId_"+formState;
	document.ffBundleForm.submit();
 
} 

function submitFFLocalBundleForm(formState)
{
	document.forms["ffLocalBundleForm"]["_eventId_findMore"].name="_eventId_"+formState;
	document.ffLocalBundleForm.submit();
 
}

function submitFFMultiCityBundleForm(formState)
{
	if (formState == 'continue'){
		sel = document.forms["ffMultiCityBundleForm"]["checkbox"];
		if (sel!=null){
	        var j=1;
			for( var i=0; i<sel.length; i++ ) 
			{
	            if (sel[i].checked)
            	{
            		document.forms["ffMultiCityBundleForm"]["additionalCity"+j].value=sel[i].id;
            		j++;
            	}
			}  
		}
	}
	document.forms["ffMultiCityBundleForm"]["_eventId_findMore"].name="_eventId_"+formState;
	document.ffMultiCityBundleForm.submit();
 
}

function submitFFRegionalBundleForm(formState)
{
	document.forms["ffRegionalBundleForm"]["_eventId_findMore"].name="_eventId_"+formState;
    var uploadFileObj = document.forms["ffRegionalBundleForm"]["logoFile"];
    //alert ('uploadFileObj : ' + uploadFileObj);
    var logFil = uploadFileObj.value;
    document.ffRegionalBundleForm.encoding = "multipart/form-data";
    if (!logFil && formState == 'upload'){
        alert ("Please select a Logo File");
        uploadFileObj.focus();
        return false;
	}
    document.ffRegionalBundleForm.submit();
} 

function TabClick(show_content_id)
{

    //make an array of content holders ids
    var contentIDs=new Array();
    $('#tabs-content > div').each(function(i){
    contentIDs[i]= $(this).attr('id');
 
     });
    
    //make an array of tab ids
    var tabIDs= new Array();
    $('#tabs-nav > div').each(function(i){
    tabIDs[i]= $(this).attr('id');    
    });
    tabbedNavigationShow(show_content_id,contentIDs,'tab-button-navoff','tab-button-navon',tabIDs);

if(show_content_id=="metro"){
document.getElementById("bestdeal").style.display="inline";
}
if((show_content_id=="metro")||(show_content_id=="multicity")){
document.getElementById("note").style.display="inline";
}

if((show_content_id=="local")||(show_content_id=="localplus")){
document.getElementById("note").style.display="none";
}


if((show_content_id=="local")||(show_content_id=="multicity")||(show_content_id=="localplus")){
	document.getElementById("bestdeal").style.display="none";
	}
}

function showcities(test){


if (test=="show"){
document.getElementById("metrocities").style.display="block";
document.getElementById("showcities").style.display="none";
document.getElementById("hidecities").style.display="inline";
}

if (test=="hide"){
document.getElementById("metrocities").style.display="none";
document.getElementById("showcities").style.display="inline";
document.getElementById("hidecities").style.display="none";
}

if (test=="multicities"){
document.getElementById("multicities").style.display="block";
document.getElementById("countycities").style.display="none";
document.getElementById("multicitieslink").style.display="none";
document.getElementById("hidemulticities").style.display="inline";
document.getElementById("countycitieslink").style.display="inline";
document.getElementById("hidecountycities").style.display="none";

}

if (test=="countycities"){
document.getElementById("countycities").style.display="block";
document.getElementById("multicities").style.display="none";
document.getElementById("countycitieslink").style.display="none";
document.getElementById("hidecountycities").style.display="inline";
document.getElementById("multicitieslink").style.display="inline";
document.getElementById("hidemulticities").style.display="none";
}

if (test=="hidecountycities"){
document.getElementById("countycities").style.display="none";
document.getElementById("multicities").style.display="none";
document.getElementById("countycitieslink").style.display="inline";
document.getElementById("multicitieslink").style.display="inline";
document.getElementById("hidemulticities").style.display="none";
}

if (test=="hidemulticities"){
document.getElementById("countycities").style.display="none";
document.getElementById("multicities").style.display="none";
document.getElementById("countycitieslink").style.display="inline";
document.getElementById("multicitieslink").style.display="inline";
document.getElementById("hidemulticities").style.display="none";
}


}

 function addCityToPreview(chkBox)
 {
    if(chkBox.checked)
    {
        if($("#selected-areas div").length == 4)
        {
            alert("You have reached the max of 4 cities including your home city.");
            chkBox.checked = false;
        }
        else
        {
            $("#selected-areas").html($("#selected-areas").html() + " <div id='"+chkBox.id+"Display'>"+chkBox.value+"</div>");
        }       
    }
    else
    {
        $('#'+chkBox.id+"Display").remove();
    }
 }
 
 function showDescText(input, location)
 {
     if(input.value.length > 4000)
         input.value = input.value.substring(0,4000);
     document.getElementById(location).innerHTML = input.value.length;
 }
 function updateCharacterLength()
 {
    
         if(document.forms["businessListingInfoForm"]["tdesc"] != null)
             document.getElementById(0).innerHTML = document.forms["businessListingInfoForm"]["tdesc"].value.length;
    
 }
 
 function trimBpDesc() {
	 
	 document.forms["businessListingInfoForm"]["tdesc"].value =  trimString(document.forms["businessListingInfoForm"]["tdesc"].value);
 }	
 
 function trimThisValue(obj ) {
	 
	 obj.value =  trimString(obj.value);
 }
 