/* bottom pane Menu  Starts */
var _LasRequestSend = ""
function fnClicktd(oTd,strIDName)
{	
	var oBottomDivs = Array('divInnovation','divRespect','divPassion','divIntegrity');	
           				
		var objtd = document.getElementById(strIDName);		
		var oDiv = document.getElementById(strIDName);		
		var intLeft = fnJSFWGetOffsetLeft(oTd);
		var intTop = fnJSFWGetOffsetTop(oTd);
		
		var objarrow = document.getElementById(strIDName);
		objtd.style.display = "block";
		objtd.style.zindex = "99";				
		var intHeight = objtd.offsetHeight;	
		var intWidth = objtd.offsetWidth;					
		objtd.style.left = parseInt(intLeft) + "px";
		objtd.style.top = (parseInt(intTop)-parseInt(intHeight))+ "px";
		objtd.style.position = "absolute";
		var screenWidth = window.screen.width;
		var newWidth = screenWidth/2;
		objtd.style.position = "absolute";
		objtd.style.left = (parseInt(newWidth)-parseInt(intWidth/2))+ "px";
		
	}
	  
	function fuMouseOut(strIDName)
	{	
	
        var oDiv = document.getElementById(strIDName)
        oDiv.style.display = "none";        
   	}
	
			
	function fnJSFWGetOffsetLeft(oEl) 
	{
			var iLeft = oEl.offsetLeft;
			while ((oEl = oEl.offsetParent) != null)
				iLeft += oEl.offsetLeft;
			return iLeft;
	}	
	function fnJSFWGetOffsetTop(oEl) 
	{
			var iTop = oEl.offsetTop;
			while((oEl = oEl.offsetParent) != null)
				iTop += oEl.offsetTop;
			return iTop;
	}
/*  bottom pane Ends */
    function redirectPageTo(strTabId , strQueryStr)
    {
     var strHostName =  String(document.getElementById('hidServerName').value); 
     if (strQueryStr != "")
        strQueryStr = "?" + strQueryStr ;
     window.document.location.href = strHostName + '/tabid/'+ strTabId+ '/Default.aspx' + strQueryStr ;
    }
   function redirectPageJL(papercontract,online)
   {
        if(document.getElementById('papercontractRadio').checked == true)
        { 
             redirectPageTo(papercontract , "ID=pc") 
            //var urlconsumer =  String(document.getElementById('urlConsumer').value);
            //window.document.location.href = urlconsumer + '?ID=pc';
            
        }
        else
        {
            redirectPageTo(online , "")        
            //var urlcontract = String(document.getElementById('urlContract').value);
            //window.document.location.href = urlcontract ;
        }
    }

	function NotificationPopup()
    {
        var childpopup =  document.getElementById('popupdiv');    
        var sHTML ="";
        sHTML =  "<table cellspacing='0' cellpadding='0' height='100%' width='100%' border='1' style='border-right:2px solid gray;border-bottom:2px solid gray' >"
        sHTML += "<tr>";
        sHTML += "<td class='popup-head' width='99%' height='2%'>Notification</td>";
        sHTML += "<td align=right class='popup-head' width='1%' style=\"cursor:pointer;\" onclick=\"document.getElementById('popupdiv').style.display='none'\" title='Close'> X </td>";
        sHTML += "</tr>";
        sHTML += "<tr>";
        sHTML += "<td id='tdNotification' colspan=2 class='popupbxpad'>" + document.getElementById('Notificationdiv').innerHTML + "</td>";
        sHTML += "</tr>";
        sHTML += "</table>";        
        childpopup.innerHTML  = sHTML ;
        childpopup.style.display = "block";
        childpopup.style.width ="400";
        //childpopup.style.height = document.getElementById('Notificationdiv').style.height;
		childpopup.style.height = "300";
        childpopup.style.position = "absolute";
        childpopup.style.left = (window.screen.width - 400)/2 ;
        childpopup.style.top = (window.screen.height - 460)/2 ;
        childpopup.style.backgroundColor  ="#ffffff";
        oSendXHRequest("SiteLogPage=More Info");
        //return false;
    }

    function MoreInfoPopup()
    {
        var childpopup =  document.getElementById('popupdiv');    
        var sHTML ="";
        sHTML =  "<table cellspacing='0' cellpadding='0' border='1' style='border-right:2px solid gray;border-bottom:2px solid gray' >"
        sHTML += "<tr>";
        sHTML += "<td class='popup-head'width='99%'>More Information</td>";
        sHTML += "<td align=right class='popup-head' width='1%' style=\"cursor:pointer;\" onclick=\"document.getElementById('popupdiv').style.display='none'\" title='Close'> X </td>";
        sHTML += "</tr>";
        sHTML += "<tr>";
        sHTML += "<td colspan=2 class='popupbxpad'>" + document.getElementById('MoreInfodiv').innerHTML + "</td>";
        sHTML += "</tr>";
        sHTML += "</table>";        
        childpopup.innerHTML  = sHTML ;
        childpopup.style.display = "block";
        childpopup.style.width ="400";
        childpopup.style.height = document.getElementById('MoreInfodiv').style.height;
        childpopup.style.position = "absolute";
        childpopup.style.left = (window.screen.width - 400)/2 ;
        childpopup.style.top = (window.screen.height - 460)/2 ;
        childpopup.style.backgroundColor  ="#ffffff";
        oSendXHRequest("SiteLogPage=More Info");
        return false;
    }
    
     function JoinLegacyPopup()
    {
      
        var childpopup =  document.getElementById('popupdiv');    
        var sHTML ="";
        sHTML =  "<table cellspacing='0' cellpadding='0' border='1' style='border-right:2px solid gray;border-bottom:2px solid gray' >"
        sHTML += "<tr>";
        sHTML += "<td class='popup-head'width='99%'>Join Legacy</td>";
        sHTML += "<td align=right class='popup-head' width='1%' style=\"cursor:pointer;\" onclick=\"document.getElementById('popupdiv').style.display='none'\" title='Close'> X </td>";
        sHTML += "</tr>";
        sHTML += "<tr>";
        sHTML += "<td colspan=2 class='popupbxpad'>" + document.getElementById('JoinLegacydiv').innerHTML + "</td>";
        sHTML += "</tr>";
        sHTML += "</table>";         
        childpopup.innerHTML  = sHTML ;
        childpopup.style.display = "block";
        childpopup.style.width ="420";
        childpopup.style.height = document.getElementById('JoinLegacydiv').style.height;
        childpopup.style.position = "absolute";
        childpopup.style.left = (window.screen.width - 420)/2 ;
        childpopup.style.top = (window.screen.height - 400)/2 ;
        childpopup.style.backgroundColor  ="#ffffff";    
        oSendXHRequest("SiteLogPage=Join Legacy");
        return false;
    }
    function onloadContuctUsform(url)
    {
        var childpopup =  document.getElementById('popupdiv');    
        var sHTML ="";
        sHTML =  "<table cellspacing='0' cellpadding='0' border='0' style='border-left:1px solid gray;border-right:2px solid gray;border-bottom:2px solid gray' width='100%' height='100%' >"
        sHTML += "<tr>";
        sHTML += "<td width='99%'  height='1'><table cellspacing='0' width='100%' cellpadding='0' border='0'  style='border-top:1px solid gray;border-bottom:2px solid gray;' ><tr><td width='99%' class='popup-head'>Online Contact Form</td>";
        sHTML += "<td width='1%' class='popup-head' style=\"cursor:pointer;\" onclick=\"document.getElementById('popupdiv').style.display='none'\" title='Close'> X </td></tr></table>";
        sHTML += "</td>";
        sHTML += "</tr>";
        sHTML += "<tr>";
       sHTML += "<td valign='top'><iframe  style='overflow-y:visible;' id='contactusframe' width='554px' height='450px' src='" + url + "' frameborder=0 ></iframe></td>";
        sHTML += "</tr>";
        sHTML += "</table>";        
        childpopup.innerHTML  = sHTML ;
        childpopup.style.display = "block";
        childpopup.style.width ="554px";
        childpopup.style.height ="474px";
        childpopup.style.position = "absolute";      
        childpopup.style.left = (window.parent.screen.width - 542)/2 ;
        childpopup.style.top = (window.parent.screen.height - 580)/2 ;
        childpopup.style.backgroundColor  ="#ffffff";
        oSendXHRequest("SiteLogPage=Contact Us");
        return false;
    }
     function onSaveContuctUsform(emailId)     
    {        
         oSendXHRequest("SendMail=" + emailId );
    }
function OpenRatingpopup(url)
{       
        var childpopup =  document.getElementById('popupdiv');    
        var sHTML ="";
        sHTML =  "<table cellspacing='0' cellpadding='0' border='1' style='border-right:2px solid gray;border-bottom:2px solid gray' width='1'>"
        sHTML += "<tr>";
        sHTML += "<td class='popup-head'width='99%'>Industry Ratings</td>";
        sHTML += "<td align=right class='popup-head' width='1' style=\"cursor:pointer;\" onclick=\"document.getElementById('popupdiv').style.display='none'\" title='Close'> X </td>";
        sHTML += "</tr>";
        sHTML += "<tr>";
        sHTML += "<td colspan=2 class='popupbxpad'>" + document.getElementById('divRatingDesc').innerHTML + "</td>";
        sHTML += "</tr>";
        sHTML += "</table>";         
        childpopup.innerHTML  = sHTML ;
        childpopup.style.display = "block";
        childpopup.style.width =  document.getElementById('divRatingDesc').style.width;
        childpopup.style.height = document.getElementById('divRatingDesc').style.height;
        childpopup.style.position = "absolute";
        childpopup.style.left = (window.screen.width - 540)/2 ;
        childpopup.style.top = (window.screen.height - 426)/2 ;
        childpopup.style.backgroundColor  ="#ffffff";
        oSendXHRequest("SiteLogPage=Product Rating");
        return false;        
}

var xmlhttp;
function __Message(str)
{
	alert(str);
}
function Init_XmlHttp() 
{
 	var A;
	try 
	{
		A=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e) 
	{
		try 
		{
			A=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (oc)
		{
			A=null;
		}
	}
	if(!A && typeof XMLHttpRequest != "undefined")
	{
		A = new XMLHttpRequest();
	}
	if (!A)
	{
		__Message("Could not create connection object.");
	}
	return A;
}

function oSendXHRequest(qString)
{   
    try 
	{
	  xmlhttp = Init_XmlHttp()       
    }
	catch (oc)
	{
		__Message(oc)
	}
    if (xmlhttp) 
	{
	    var url =  getRequestUrl(qString)	
	    if ( url != _LasRequestSend)
	    {
	        _LasRequestSend = url ;
		    xmlhttp.open("GET", url, true); // true --> Asynchronous		
		    xmlhttp.onreadystatechange = oHandle;
		    xmlhttp.send(null);
		    delete xmlhttp;
		}
	
	} 
}
function  getRequestUrl(qString)
{
 var url = document.URL ;
 if (url.indexOf("#") != -1)
    {
       url = url.replace("#","")
    }	    
    if (url.indexOf("?") != -1)
        url += "&mode=remote&" + qString;
    else
        url += "?mode=remote&" + qString;	   
 return url ; 
}
function oHandle()
{

    // only if req shows "loaded"
	if (xmlhttp.readyState == 4) 
	{
	 	// only if "OK"
	 	
		if (xmlhttp.status == 200) 
		{
			// ...processing statements go here...
			
		    var sHtml = String( xmlhttp.responseText );	
		    var url = String(document.URL) ;
		    if (url.lastIndexOf('Trace=Error')!= -1)
		    {		        
	            DisplayResponse(sHtml)
	        }
		}
		else 
		{
			__Message("There was a problem retrieving the XML data:\n" + xmlhttp.statusText);
		}
	}
}		
function DisplayResponse(sClientHtml)
{
    var chidwin = window.open(" STATUS NOT FOUND ","","");
    chidwin.document.write(sClientHtml.replace("jsscripts/legacy.js",""));
    chidwin.document.close();	    	
    return true;    
}
function CloseMessage()
{
	var oMessageDiv = document.getElementById('MessageDiv');
    oMessageDiv.innerHTML = '';
    oMessageDiv.style.display = 'none';
}





//    var popupwidth = 512 ;
//    var popupheight = 326 ;
//    var left = (window.screen.width - popupwidth)/2;
//    var top = (window.screen.height - popupwidth)/2 + 70;
//    var chidwin = window.open("Rating","","left=" + left + ",top=" + top + ",width=" + popupwidth + ",height=" + popupheight + ",resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no");
//    chidwin.document.write("<html>");
//    chidwin.document.write("<head>");
//    chidwin.document.write("<title>Ratings - Legacy Marketing Group - LegacyNet.com</title>");
//    var arr = document.getElementsByTagName('link');
//	    for (var i=0; i< arr.length; i++)
//	    {
//	        if (String(arr[i].href).indexOf('Carriers/module') != -1 )
//		    chidwin.document.write('<link href="' + arr[i].href + '" type=text/css rel=stylesheet>');
//	    }
//    chidwin.document.write("</head>");
//    chidwin.document.write("<body  sytle=\"background-color='#ffffff';margin='15px';overflow:'auto';\">");
//    chidwin.document.write(document.getElementById('divRatingDesc').innerHTML);
//    chidwin.document.write("</body>");
//    chidwin.document.write("</html>");
//    chidwin.document.close();

//     function JoinLegacyPopup()
//    {
//     var childwin =  window.open('Join Legacy','Declaration','width=420,height=250,top=205,left=250,menubar=no,scrollbars=yes,status=no,toolbar=no');
//     var arr = document.getElementsByTagName('link');
//     var JSString = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><head>";
//     JSString +="<title>Join Legacy - LegacyNet</title>";
//        for (var i=0; i< arr.length; i++)
//        {        
//          JSString += '<link href="' + arr[i].href + '" type=text/css rel=stylesheet> ';
//        }

//     JSString += "<script type='text/javascript' language='javascript'>";
//     JSString += "function rediredtParent()";
//     JSString += "{";
//     JSString += "  if(document.getElementById('papercontractRadio').checked == true)";
//     JSString += "  {"; 
//     var urlconsumer =  String(document.getElementById('urlConsumer').value);
//     JSString += "      window.opener.document.location='" + urlconsumer + "?ID=pc';window.close();";
//     JSString += "  }";
//     JSString += "  else";
//     JSString += "  {";
//     var urlcontract = String(document.getElementById('urlContract').value);
//     JSString += "      window.opener.document.location='" + urlcontract + "';window.close();";
//     JSString += "  }";
//     JSString += "}";
//     JSString += "</sc"+"ript></head><body class='popupbxpad' >";
//     childwin.document.write(JSString+document.getElementById('JoinLegacydiv').innerHTML + "</body></html>");
//     childwin.document.close();
//     return false;
//    }
    
//    function IframeLoaded()
//    {
//        var url = String(window.document.location.href);
//        var subUrl = url.split("?");       
//        //document.write('<iframe src=" http://dev.legacynet.com/lmg/rz/pubrzcalc.asp?selProduct=18&hidMode=P" width="780px" height="400px" scrolling = "yes" >Browser Does Not Support Iframe</iframe>');
//      //    document.write('<iframe src="http://localhost/DNN437/DesktopModules/Page2.htm" width="780px" height="400px" scrolling = "yes" frameborder="0" >Browser Does Not Support Iframe</iframe>');
//        document.write('<iframe src="http://dev.legacynet.com/lmg/rz/pubrzcalc.asp?'+ subUrl[1] +'" width="780px" height="400px" scrolling = "yes" frameborder="0" >Browser Does Not Support Iframe</iframe>');
//        return true;
    // ''<a href=''''' + @sHTTPAlias +  '/'' + TabName +  ''/tabid/'' + Cast(TabID as varchar(5)) +  ''/Default.aspx''''  >'' + TabName +  ''</a>'' as Name ,
	
//    }    
 