


	





	



function setGoogleCollection(env) {

    // This changes the site to be searched based on the selection made.
   	// The resultpage needs the 'sec' parameter for setting the selection box during paging.
   	var site = document.googlesearch.section.options[document.googlesearch.section.selectedIndex].value;
   	var RqFld = "site:"+site;

    if(site == "LibertyMutualGlobal" || site == "pm_libertymutual"){ 
        RqFld = "";
        document.googlesearch.site.value = site;
        
        if(env == "DEV" || env == "TEST"){
            document.googlesearch.srv.value = "";
        }
    }
    else{
        document.googlesearch.site.value = "LMGroup";
        
        if(env == "DEV" || env == "TEST"){
            document.googlesearch.srv.value = "http://www-test.libertymutualgroup.com";
        }
    }
   
    document.googlesearch.requiredfields.value = RqFld;
    document.googlesearch.myparms.value = "ft=6,sec="+site;
    document.googlesearch.sec.value = site;
}

function checkEntry(form) {   
    var query = form.q.value;
    if (query == '')
    {
    	alert('Please enter a search value.');
    	form.q.focus();
        return false;  
    } 
    else{
        return true;
    }
}

function printerFriendly(contentID) {
      var url=window.location + "&PF=1";
      window.open(url,"newwin","left=150,top=150,width=430,height=500,resizable=1,scrollbars=1");
}

function addBookmark(title, url){
  if(window.sidebar){ // Firefox
    window.sidebar.addPanel(title, url,'');
  }else if(window.opera){ //Opera
    var a = document.createElement("A");
    a.rel = "sidebar";
    a.target = "_search";
    a.title = title;
    a.href = url;
    a.click();
  } else if(document.all){ //IE
    window.external.AddFavorite(url, title);
  }
}

  function printerFriendlyAll() {	   
       
	   var contentRangeHTML = document.getElementById("contentrange");
       var myObject = new Object();
	   myObject.printerContent = contentRangeHTML.innerHTML;
	
	   // The object "myObject" is sent to the modal window.
       var url="ContentServer?pagename=LMGroup/Common/lmgPrinterFriendly";
       
       //alert(url);
       xShowModalDialog(url, myObject, 'dialogHeight:600px; dialogWidth:550px; dialogLeft:50px;');
	
	}
    function xShowModalDialog( sURL, vArguments, sFeatures ) 
    { 
     
    if (sURL==null||sURL=='') 
    { 
        alert ("Invalid URL input."); 
        return false; 
    } 
    if (vArguments==null||vArguments=='') 
    { 
        alert("emptyArgs");
        vArguments='';
    } 
    if (sFeatures==null||sFeatures=='') 
    { 
        sFeatures=dFeatures; 
    } 
    if (window.navigator.appVersion.indexOf("MSIE")!=-1) 
    { 
        window.showModalDialog ( sURL, vArguments, sFeatures ); 
        return false; 
    } 
    
    sFeatures = sFeatures.replace(/ /gi,''); 
   
    aFeatures = sFeatures.split(";"); 
    sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,scrollbars=1,"; 
    for ( x in aFeatures ) 
    { 
        aTmp = aFeatures[x].split(":"); 
        sKey = aTmp[0].toLowerCase(); 
        sVal = aTmp[1]; 
        switch (sKey) 
        { 
            case "dialogheight": 
                sWinFeat += "height="+sVal+","; 
                pHeight = sVal; 
                break; 
            case "dialogwidth": 
                sWinFeat += "width="+sVal+","; 
                pWidth = sVal; 
                break; 
            case "dialogtop": 
                sWinFeat += "screenY="+sVal+","; 
                break; 
            case "dialogleft": 
                sWinFeat += "screenX="+sVal+","; 
                break; 
            case "resizable": 
                sWinFeat += "resizable="+sVal+","; 
                break; 
            case "status": 
                sWinFeat += "status="+sVal+","; 
                break; 
            case "center": 
                if ( sVal.toLowerCase() == "yes" ) 
                { 
                    sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+","; 
                    sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+","; 
                } 
                break; 
        } 
    } 
    modalWin=window.open(String(sURL),"",sWinFeat); 
    if (vArguments!=null&&vArguments!='') 
    { 
        modalWin.dialogArguments=vArguments; 
    } 
}


function email(ft,fid) {
      var  csurl="ContentServer?pagename=LMGroup/Common/lmgEmail";
      
      
       csurl = csurl + "&ft="+ft+"&fid="+fid;
     //  alert("CS URL " +csurl);
      window.open(csurl,"newwin","left=150,top=150,width=470,height=500,resizable=1,scrollbars=1");
}

function email2(ft,cid) {
      var  csurl="ContentServer?pagename=LMGroup/Common/lmgEmail";
      
      
       csurl = csurl + "&ft="+ft+"&cid="+cid;
     //  alert("CS URL " +csurl);
      window.open(csurl,"newwin","left=150,top=150,width=470,height=500,resizable=1,scrollbars=1");
}


function findPosY(obj)
{
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
            curtop += obj.offsetTop;
            if(!obj.offsetParent)
                break;
            obj = obj.offsetParent;
        }
        else if(obj.y)
            curtop += obj.y;
        return curtop;
}
function setIframe(){
    if(document.getElementById("rightPollFrame")){
        var iFrame = document.getElementById("rightPollFrame");
        var height = findPosY(iFrame.contentWindow.document.getElementById("iframeBottom"));
        iFrame.style.height = height + "px";
    }
}

function popUpContent(id){
    var url = "ContentServer?pagename=LMGroup/Views/lmgView97&cid=" + id;
    var win = window.open(url,"win",'height=350,width=450,scrollbars');
    win.moveTo(193,175);
    win.focus();
}

function popUpLg(id){
    var url = "ContentServer?pagename=LMGroup/Views/lmgView97&cid=" + id;
    var win = window.open(url,"win",'height=535,width=529,scrollbars,resizable');
    win.moveTo(193,175);
    win.focus();
}

function popUpSm(id){
    var url = "ContentServer?pagename=LMGroup/Views/lmgView97&cid=" + id;
    var win = window.open(url,"win",'height=400,width=360,scrollbars,resizable');
    win.moveTo(193,175);
    win.focus();
}

function popUpNews(id){
    var url = "ContentServer?pagename=LMGroup/Views/lmgView98&kw=false&cid=" + id;
    var win = window.open(url,"win",'height=500,width=525,scrollbars=yes');
    win.moveTo(193,175);
    win.focus();
}

// DO NOT DELETE - This is a required variable for rotate modules
var hasRotateModules="false";

