function open_MyAccount(strURL)
{	
	TopNavWebMetrics('MyAccount','');
	strURL=strURL+escape(document.location.href);
    window.location.href=strURL;
}

//function for Menu Creation
function getposOffset(what, offsettype)
{
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
     }
    return totaloffset;
}

//function for Menu Creation
function showhide(obj, e, visible, hidden, menuwidth)
{
    if (ie4||ns6)
        dropmenuobj.style.left=dropmenuobj.style.top=-500
    else
        dropmenuobj.style.left=dropmenuobj.style.top=-400
    if (menuwidth!=""){
        dropmenuobj.widthobj=dropmenuobj.style
        dropmenuobj.widthobj.width=menuwidth
    }
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
        obj.visibility=visible
    else if (e.type=="click")
        obj.visibility=hidden
}

//function for Menu Creation
function iecompattest()
{
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

//function for Menu Creation
function clearbrowseredge(obj, whichedge)
{
    var edgeoffset=0
    if (whichedge=="rightedge"){
        var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
        dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
        if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
            edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
    }
    else{
        var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
        var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
        dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
        if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
            edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
        if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
            edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
        }
    }
    return edgeoffset
}

//function for Menu Creation
function populatemenu(what)
{
if (ie4||ns6)
	dropmenuobj.innerHTML=what.join("")
else
	dropmenuobj.innerHTML=what.join("")
}

/// functions are designed to change the Images of the Utilities and Communities Menus as per the MouseOver
function changeMe(idImg,url)
{
    var ImgUrl=url;
    idImg.src=ImgUrl;
}

/// functions are designed to change the Images of the Utilities and Communities Menus as per the Mouseout
function changeMeOut(idImg,url)
{
    var ImgUrl = url;
    idImg.src=ImgUrl;
}

//Function for Creating Menu 
function clickreturnvalue()
{
    if (ie4||ns6) return false
    else return true
}

//Function for Creating Menu 
function contains_ns6(a, b) 
{
    while (b.parentNode)
    if ((b = b.parentNode) == a)
        return true;
    return false;
}

//Function for Creating Menu 
function dynamichide(e)
{
    if (ie4&&!dropmenuobj.contains(e.toElement))
        delayhidemenu()
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
        delayhidemenu()
}

//Function for Creating Menu 
function hidemenu(e)
{
    if (typeof dropmenuobj!="undefined"){
    if (ie4||ns6)
        dropmenuobj.style.visibility="hidden"
    }
}

//Function for Creating Menu 
function delayhidemenu()
{
    if (ie4||ns6)
    delayhide=setTimeout("hidemenu()",disappeardelay)
}

//Function for Creating Menu 
function clearhidemenu()
{
    if (typeof delayhide!="undefined")
    clearTimeout(delayhide)
}

function changeText()
{
    var userText= document.getElementById("ctl00_txtUserName");
    if(userText.value=='enter user name')
    {
        userText.value='';
    }
}

function doLogin()
{
    var userName = document.getElementById("ctl00_txtUserName");
    var userPassword = document.getElementById("ctl00_pwdUserPassword");
    var userNameChars  = "~`!#$%^&*()+=[]\\\';,/{}|\":<>?"
    var passwordChars  = "<&\""
    /*if(userName.value.length == 0)
    {
        alert ("Please enter the Email.");
	    return false;
    }
    else
    {
    for (var i = 0;i < userName.value.length;i++) 
    {
		    if (userNameChars.indexOf(userName.value.charAt(i)) != -1)
			    {
			    alert ("Email Field allows only @ , . , _ and - special characters.");
			    userName.value=""
			    return false;
		    }
    }
    for (var i = 0;i < userPassword.value.length;i++) 
    {
		    if (passwordChars.indexOf(userPassword.value.charAt(i)) != -1)
		    {
			    alert ("Password Field dose not allow < , & and \"  special characters.")
			    userPassword.value=""
			    return false;
		    }
    }
    }*/
    var cb = document.getElementById('chkRememberLogin');
    if (!cb || !cb.checked)
    {
        deleteLoginInfo();
    }
    else
    {
        if(userName.value.length > 0)
        {
            storeLoginInfo(userName.value,'default');
        }
    }
}


/// To Check for Initialization of SAMessage
function CheckSAMessageInitializationCommon(message,concatenationCharacter)
{
var vconcatenationCharacter="&"
if(concatenationCharacter)
	vconcatenationCharacter=concatenationCharacter
if (message==undefined||message.length==0)
	{
		return message;
	}
else
	{
		return message + vconcatenationCharacter;
	}
}

function InsertWebMetricsData_CPRT(parameterNames, parameterValues, internalURL) {
    if (parameterNames.indexOf("|") != -1)
        InsertWebMetricsDataCommon(parameterNames, parameterValues, internalURL, "|")
    else
        InsertWebMetricsDataCommon(parameterNames, parameterValues, internalURL, '')
}

/// Inserting Web Metrics Data

//Checks for Enter key press
function keyPressHandle(e)
 {
    var keyCode=e.keyCode;
    var element = e.target || e.srcElement;
    if(keyCode==13)
     {
        if(element.id=="ctl00_txtUserName" || element.id=="ctl00_pwdUserPassword")
        {
            document.getElementById("ctl00_imgBtnSignIn").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if (element.id == "ctl00_ContentPlaceHolder1_txtSearchTerm" || element.id == "ctl00_ContentPlaceHolder1_txtPostalCode")
        {
            document.getElementById("ctl00_ContentPlaceHolder1_btnGo").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if (element.id == "ctl00_ContentPlaceHolder1_homeSearchUserControl_txtSearchTerm")
        {
            document.getElementById("ctl00_ContentPlaceHolder1_homeSearchUserControl_searchGoButton").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if (element.id == "ctl00_ContentPlaceHolder1_searchUserControl_txtSearchTerm")
        {
            document.getElementById("ctl00_ContentPlaceHolder1_searchUserControl_searchGoButton").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if (element.id == "ctl00_ContentPlaceHolder1_searchDivSecUserControl_txtSearchTerm")
        {
            document.getElementById("ctl00_ContentPlaceHolder1_searchDivSecUserControl_searchGoButton").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if (element.id == "ctl00_ContentPlaceHolder1_homeSearchUserControl_txtSearchTerm")
        {
            document.getElementById("ctl00_ContentPlaceHolder1_homeSearchUserControl_searchGoButton").click();
            e.returnValue=false; 
            e.cancel = true;
        }
        else if(!(element.tagName.toLowerCase() == "textarea"))
        {
            e.returnValue=false; 
            e.cancel = true;
        }
     }
 }

/// This function delay the calling of getQueryUrl function so that whole page will be loaded and divId will be get to display
function buildMenu()
{
    //Code added to initiate dropdown menu contents for before and after login
    if(document.getElementById("ctl00_divBeforeLogin")!=null)
    {

    dropdownmenu1("parent_communities", "menu_child", "hover", "y", "pointer");
    dropdownmenu1("parent_Utilities", "menu_child2", "hover", "y", "pointer");
    }
    else if(null!=document.getElementById("ctl00_divAfterLogin"))
    {
    dropdownmenu1("parent_communities_Login", "menu_child", "hover", "y", "pointer");
    dropdownmenu1("parent_Utilities_Login", "menu_child2", "hover", "y", "pointer");
    }
}

//Function for Product center click
function callwebmetrics(ParamNames,ParamValues,InternalURL)
{
    InsertWebMetricsDataCommon(ParamNames,ParamValues,InternalURL);
}

//Top Navigation links webmetric
function TopNavWebMetrics(pageCaption,navTwo,url)
{		
	var nav		 = GetTopWebMetricsNav(pageCaption)
	var WMParam 
	var WMValues	
	var Url
	if(pageCaption=='Forums'||navTwo=='help'||navTwo=='faq'||navTwo=='glossary')
	{
		//Forums TopNavigation Webmetrics			
		WMParam = document.getElementById('ctl00_hdnParamNames').value+ ','+'act'
		WMValues = document.getElementById('ctl00_hdnParamValues').value + ','+ nav + ',' + '' +','+'xrefer'
		Url = url
	}
	else
	{
		WMParam  = document.getElementById('ctl00_hdnParamNames').value 	
		WMValues = document.getElementById('ctl00_hdnParamValues').value + ','+ nav + ',' + navTwo
		Url = document.getElementById('ctl00_hdnInternalURL').value
	}	
	InsertWebMetricsDataCommon(WMParam,WMValues,Url,'')	
}

//Get Header webmetrics nav2 values
function  GetTopWebMetricsNav(pageName)
{
	switch(pageName)
		{
		case 'Home':
	 		strnav="tophm"
			return strnav
		case 'FindARep':
	 		strnav="toprep";
			return strnav
		case 'Education':
	 		strnav="toped";
	 		return strnav
		case 'Utilities':
	 		strnav="toput";
			return strnav
		case 'Spotlights':
	 		strnav="topsp";
			return strnav
		case 'MyAccount':
	 		strnav="topma";
			return strnav
		case 'Forums':
	 		strnav="topfo";	
			return strnav
		case 'SNAP':
 		    strnav="SNAP";
		    return strnav	
		default:
			return ''
		}
}

function getCookie( name ) { var start = document.cookie.indexOf( name + "=" ); var len = start + name.length + 1; if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { return null; } if ( start == -1 ) return null; var end = document.cookie.indexOf( ";", len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring( len, end ) ); } 

function deleteCookie( name, path, domain ) { if ( getCookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } 

function setCookie(c_name,value,expiredays)
{
    var exdate=new Date()
    exdate.setDate(exdate.getDate()+expiredays)
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}


function navigateUtilityURLs(selectedUtility)
{
    var arr1 =  new Array();
    var var1=document.getElementById('ctl00_hdnHref');
    arr1=(var1.value).split(",");
    if(selectedUtility =='help')
    {
        window.open(arr1[0])
        return;
    }
    else if(selectedUtility =='resource')
    {
        var resourceLink=document.getElementById('ctl00_hdnResourceLink');
        //document.location.href = resourceLink.value;
        return;
    }
    else if(selectedUtility =='FAQ')
    {
        window.open(arr1[4])
        return;
    }
    else if(selectedUtility =='download')
    {
        var downloadLink=document.getElementById('ctl00_hdnDownloadLink');
        //document.location.href = downloadLink.value;
        return;
    }
}

function webmetrics_Utility(selectedUtility)
{
    var arr1=new Array();
    var tempVar=document.getElementById('ctl00_hdnHref');
    arr1=(tempVar.value).split(",");

    if(selectedUtility =='help')
    {
        TopNavWebMetrics("Utilities","help",arr1[0])
        //TopNavWebMetrics("Utilities","help","http://www.construction.com/help/SweetsHelp/default.asp")
        return ;
    }
    else if(selectedUtility =='resource')
    {
        var resourceLink=document.getElementById('ctl00_hdnResourceLink');
        TopNavWebMetrics("Utilities","resource",resourceLink.value)
        return ;
    }
    else if(selectedUtility =='FAQ')
    {
        TopNavWebMetrics("Utilities","faq",arr1[4])
        return ;
    }
    else if(selectedUtility =='download')
    {
        var downloadLink=document.getElementById('ctl00_hdnDownloadLink');
        TopNavWebMetrics("Utilities","downloads",downloadLink.value)
        return ;
    }
}

//Refreshing the page while changing the community.
function refresh(communitySelected)
{
    var retnav2=getnav2(communitySelected)
    var nav="toppc"
    var valHiddenParamValues=''
    var valHiddenParamNames=''
    var valHiddenInternalURL=''
    
    if(null!=document.getElementById('ctl00_hdnParamNames'))
        valHiddenParamNames=document.getElementById('ctl00_hdnParamNames').value
    
    if(null!=document.getElementById('ctl00_hdnParamValues'))
        valHiddenParamValues=document.getElementById('ctl00_hdnParamValues').value
    
    if(null!=document.getElementById('ctl00_hdnInternalURL'))
        valHiddenInternalURL=document.getElementById('ctl00_hdnInternalURL').value
    
    var valParamValues=valHiddenParamValues+','+nav+','+retnav2
        callwebmetrics(valHiddenParamNames,valParamValues,valHiddenInternalURL)
    
    //navigateCommunity(communitySelected);    
}


// ----- Popup Control -------
// ----- Show Aux -----

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;
  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }

  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ----- Show -----

function at_show()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);
  
  at_show_aux(p.id, c.id);

  clearTimeout(c["at_timeout"]);
}

// ----- Hide -----

function at_hide()
{
  var c = document.getElementById(this["at_child"]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 100);
}

// ----- Click -----

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.visibility != "visible")
       at_show_aux(p.id, c.id);
  else c.style.visibility = "hidden";

  return false;
}

// ----- Attach -----

// PARAMETERS:
// parent   - id of visible html element
// child    - id of invisible html element that will be dropdowned
// showtype - "click" = you should click the parent to show/hide the child
//            "hover" = you should place the mouse over the parent to show
//                      the child
// position - "x" = the child is displayed to the right of the parent
//            "y" = the child is displayed below the parent
// cursor   - Omit to use default cursor or check any CSS manual for possible
//            values of this field

function dropdownmenu1(parent, child, showtype, position, cursor)
{
  
  var p = document.getElementById(parent);
  var c = document.getElementById(child);
  
  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;
switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

function deleteLoginInfo()
{
    writeLoginCookie('','');
}

function storeLoginInfo(userName,authSource)
{
    var value = 'user\t' + userName + '\nauth\t' + authSource;
    var expires = daysAway(60);
    writeLoginCookie(value,expires);
}

function restoreLoginInfo()
{
    var cookie = retrieveCookie('lastLogin');
    if (cookie)
    {
        var nvPairs = cookie.split('\n');
        if (nvPairs && nvPairs.length)
        {
            var foundUser = false;
            for (var i = 0; i < nvPairs.length; i++)
            {
                var pair = nvPairs[i];
                if (!pair) { continue; }
                var vals = pair.split('\t');
                var key = vals[0];
                var val = vals[1];
                if (key == 'user')
                {
                    var usr = document.getElementById("ctl00_txtUserName");
                    if (usr)
                    {
                        usr.value = val;
                        foundUser = true;
                    }
                }
             }
            var cb = document.getElementById('chkRememberLogin');
            if (cb) { cb.checked = true; }
            (foundUser) ? focusPasswordField() : focusUserTextbox();
        } else { focusUserTextbox(); }
    } else { focusUserTextbox(); }
}

function focusUserTextbox()
{
    var usr = document.getElementById("ctl00_txtUserName");
    if (usr) { usr.focus(); }
}

function focusPasswordField()
{
    var pw = document.getElementById("ctl00_pwdUserPassword")
    if (pw) { pw.focus(); }
}

function writeLoginCookie(value,expires)
{
    storeCookie('lastLogin',value,expires);
}


function daysAway(numDays)
{
    var exp = new Date();
	var oneDay = (1000 * 60 * 60 * 24);  
	return new Date(exp.setTime(exp.getTime() + (oneDay * numDays)));
}

function retrieveCookie(name)
{
	var cname = name + '=';
	if (document.cookie.length > 0) {
		begin = document.cookie.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) {end = document.cookie.length;}
			return unescape(document.cookie.substring(begin,end));
		}
	} else {
		return;
	}
}

function storeCookie(name,value,expires)
{
	document.cookie = name + "=" + escape(value) + ';path=/' + ((!expires) ? '' : ';expires=' + expires.toGMTString());
	return;
}

function doOnLoad()
{
	restoreLoginInfo();
	setTimeout("buildMenu()",1000)
}

//initalizing the menu array
var menu1		=	new Array();
var Commmenu1	=	new Array();
var menuwidth		= '10px' //default menu width
var menubgcolor		= 'white'  //menu bgcolor
var disappeardelay	= 250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick= "yes" //hide menu when user clicks within menu?
var ie4				= document.all
var ns6				= document.getElementById&&!document.all

if (hidemenu_onclick=="yes")
document.onclick=hidemenu 

//code for generating Menu  
function dropdownmenu(obj, e, menucontents, menuwidth)
{
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu();
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
    
    // CREATING MENU FOR COMMUNITIES LINK
    var arr1=new Array();
    var var1=document.getElementById('ctl00_hdnHref');
    arr1=(var1.value).split(",");
    var imgServerAnchor=document.getElementById('ctl00_imgServerPath');
    var varImgServerPath=imgServerAnchor.href;
    var glossaryFile="http://www.construction.com/help/ProductNetwork/Dictionary_of_Sweets_Indexing_Terms.htm";
    var resourceLink=document.getElementById('ctl00_hdnResourceLink');
    var downloadLink=document.getElementById('ctl00_hdnDownloadLink');
    /* Utilities Menu */
    var arrUtilities=new Array();
    var varUtilities=document.getElementById('ctl00_hdnUtilMenuImg');
    var varUtiliteCaption='Utilities'
    var varUtilitehelp='help'
    arrUtilities=(varUtilities.value).split(",");
    menu1[0]='<a target=_blank   onmouseover=changeMe(imgHelp,'+ "'" + varImgServerPath+arrUtilities[6] + "'" + ') onmouseout=changeMeOut(imgHelp,' + "'" + varImgServerPath+arrUtilities[0] + "'" + ') href=' +arr1[0] + ' onclick=TopNavWebMetrics("Utilities","help",' + "'" +arr1[0] + "'" + ')><img  border="0" src=' + "'" + varImgServerPath+arrUtilities[0] +"'" +   'name="imgHelp" id="imgHelp"></a>'
    menu1[2]='<a onmouseover=changeMe(imgresLinks,' + "'" + varImgServerPath+arrUtilities[8] + "'" + ') onmouseout=changeMeOut(imgresLinks,' + "'" + varImgServerPath+arrUtilities[2] + "'" + ')  href='+ resourceLink.value +' onclick=TopNavWebMetrics("Utilities","resource",' + "'" +resourceLink.value + "'" + ')><img  border="0" src='+ "'" + varImgServerPath+arrUtilities[2] +"'" +  'name="imgresLinks" id="imgresLinks"></a>'
    //menu1[3]='<a target=_blank onmouseover=changeMe(imgGlossary,' + "'" + varImgServerPath+arrUtilities[9] + "'" + ') onmouseout=changeMeOut(imgGlossary,' + "'" + varImgServerPath+arrUtilities[3] + "'" + ')  href=' + glossaryFile + ' onclick=TopNavWebMetrics("Utilities","glossary",' + "'" +glossaryFile + "'" + ')><img border="0" src='+ "'" + varImgServerPath+arrUtilities[3] +"'" +  'name="imgGlossary" id="imgGlossary"></a>'
    menu1[3]='<a target=_blank onmouseover=changeMe(imgFaq,' + "'" + varImgServerPath+arrUtilities[10] + "'" + ') onmouseout=changeMeOut(imgFaq,' + "'" + varImgServerPath+arrUtilities[4] + "'" + ')  href=' +arr1[4] + ' onclick=TopNavWebMetrics("Utilities","faq",' + "'" +arr1[4] + "'" + ')><img border="0" src='+ "'" + varImgServerPath+arrUtilities[4] +"'" +  'name="imgFaq" id="imgFaq"></a>'
    menu1[4]='<a onmouseover=changeMe(imgDownlinks,' + "'" + varImgServerPath+arrUtilities[13] + "'" + ') onmouseout=changeMeOut(imgDownlinks,' + "'" + varImgServerPath+arrUtilities[12] + "'" + ')  href='+ downloadLink.value +' onclick=TopNavWebMetrics("Utilities","downloads",' + "'" +downloadLink.value + "'" + ')><img  border="0" src='+ "'" + varImgServerPath+arrUtilities[12] +"'" +  'name="imgDownlinks" id="imgDownlinks"></a>'

    /* Communities Menu */
    var arrCommunities=new Array();
    var varCommunities=document.getElementById('ctl00_hdnCommMenuImg');
    arrCommunities=(varCommunities.value).split(",");
    Commmenu1[0]='<a onmouseover=changeMe(imgaec,'+ "'" + varImgServerPath+arrCommunities[7] + "'" + ') onmouseout=changeMeOut(imgaec,' + "'" + varImgServerPath+arrCommunities[0] + "'" + ') href=javascript:refresh('+"'\AEC\'"+')><img  border="0" src=' + "'" + varImgServerPath+arrCommunities[0] +"'" +   'name="imgaec" id="imgaec"></a>'
    Commmenu1[1]='<a onmouseover=changeMe(imgfacilities,' +"'" +  varImgServerPath+arrCommunities[8] + "'" + ') onmouseout=changeMeOut(imgfacilities,' + "'" + varImgServerPath+arrCommunities[1] + "'" + ')  href=javascript:refresh('+"'facilities'"+')><img border="0" src='+ "'" + varImgServerPath+arrCommunities[1] +"'" +  'name="imgfacilities" id="imgfacilities"></a>'
    Commmenu1[2]='<a onmouseover=changeMe(imgresidential,' + "'" + varImgServerPath+arrCommunities[9] + "'" + ') onmouseout=changeMeOut(imgresidential,' + "'" + varImgServerPath+arrCommunities[2] + "'" + ')  href=javascript:refresh('+"'residential'"+')><img  border="0" src='+ "'" + varImgServerPath+arrCommunities[2] +"'" +  'name="imgresidential" id="imgresidential"></a>'
    Commmenu1[3]='<a onmouseover=changeMe(imgcanadian,' + "'" + varImgServerPath+arrCommunities[10] + "'" + ') onmouseout=changeMeOut(imgcanadian,' + "'" + varImgServerPath+arrCommunities[3] + "'" + ')  href=javascript:refresh('+"'\canadian\'"+')><img border="0" src='+ "'" + varImgServerPath+arrCommunities[3] +"'" +  'name="imgcanadian" id="imgcanadian"></a>'
    Commmenu1[4]='<a onmouseover=changeMe(imglandscapearc,' + "'" + varImgServerPath+arrCommunities[11] + "'" + ') onmouseout=changeMeOut(imglandscapearc,' + "'" + varImgServerPath+arrCommunities[4] + "'" + ') href=javascript:refresh('+"'\landscape\'"+')><img border="0" src='+ "'" + varImgServerPath+arrCommunities[4] +"'" +  'name="imglandscapearc" id="imglandscapearc"></a>'
    //Commmenu1[5]='<a onmouseover=changeMe(imgsubcontractor,' + "'" + varImgServerPath+arrCommunities[12] + "'" + ') onmouseout=changeMeOut(imgsubcontractor,' + "'" + varImgServerPath+arrCommunities[5] + "'" + ') HREF=javascript:refresh('+"'\green\'"+')><img border="0" src='+ "'" + varImgServerPath+arrCommunities[5] +"'" +  'name="imgsubcontractor" id="imgsubcontractor"></a>'
    populatemenu(menucontents)
    if (ie4||ns6)
    {
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
    }
    return clickreturnvalue()
}

function doNothing() { }

//TO set the Current Page for pagination control
function SetCurrentPage(objIdCurPage, objEvent, objIdDopaging) {
    objCurPage = document.getElementById(objIdCurPage);
    objDopaging = document.getElementById(objIdDopaging)
    objDopaging.value = "true"
    var CurPage = parseInt(objCurPage.value);

    if (objEvent == "Next") {
        objCurPage.value = CurPage + 1
    }
    else if (objEvent == "Prev") {
        objCurPage.value = CurPage - 1
    }
    else {
        objCurPage.value = objEvent
    }
}
//********************added by ujjwala on 03-07-2008 for web metrices ****************
function SetWebmetricsParams(celId,action,contentType,fileorUrlflag,url,entityID)
{
var strWebmetricsValues=document.getElementById('ctl00_ContentPlaceHolder1_hdnCPRHSWebmetricsValues').value
var	strWebmetricsParams=document.getElementById('ctl00_ContentPlaceHolder1_hdnCPRHSWebmetricsParams').value	
var strInternalUrl=document.getElementById('ctl00_ContentPlaceHolder1_hdnCPRHSWebmetricsUrl').value
var arrWebmetricsValues = strWebmetricsValues.split(",")
if(entityID!=undefined)
{
	var strEntityId = entityID.split("|")	
	if(strEntityId[0]=='F')
		arrWebmetricsValues[3]=strEntityId[1]
	else if(strEntityId[0]=='P')
		arrWebmetricsValues[4]=strEntityId[1]
}
arrWebmetricsValues[5]=celId
arrWebmetricsValues[6]=""
arrWebmetricsValues[7]=action
arrWebmetricsValues[8]=contentType
strWebmetricsValues=arrWebmetricsValues.join(",")
//if(fileorUrlflag == 'U')
    //strInternalUrl = url
InsertWebMetricsData_CPRT(strWebmetricsParams,strWebmetricsValues,strInternalUrl)
}

function openOtherSitesLinks(elementId)
{
	var cboSelect=document.getElementById(elementId)
	if (cboSelect.selectedIndex>0) 
		if (cboSelect.selectedIndex!=1&&cboSelect.selectedIndex!=12&&cboSelect.selectedIndex!=11)
		{
			window.open(cboSelect.value,"")
		}
}
//Login Alert
function LoginAlert(strOpenWindowMsg, nLeft, nTop, nWidth, nHeight) {
    window.open(strOpenWindowMsg, 'CustomPopUp', 'left=' + nLeft + ',top=' + nTop + ',width=' + nWidth + ',height=' + nHeight + ',menubar=no,resizable=no')
}