 
 
 // parameters:
// page = page to open
// target = window name to open page in
// parms = any of the default parameters that need to be overwritten

// function should be called as follows:
// <a href="javascript: openWindow(pagename[,targetname,parameters]);">
//
// enclose each parameter in single quotes.
// ex 1:  openWindow('/safeco/mypage.asp');	  --only passes the required page parameter and accepts the defaults
// ex 2:  openWindow('/safeco/mypage.asp','myWindow');    --only passes the req page parm and target window name
// ex 3:  openWindow('/safeco/mypage.asp','','resizable=no,height=700');    --passes the req page parm and overrides 2 default params


function openWindow(page,target,params){
	if(target==null || target=='') target = 'NewWindow';
	var defaults = 'status=yes,location=yes,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,width=770,height=550,top=50,left=50';
	var overrides = params;
	window.open(page,target,defaults + overrides); 
}

//--------------------------------------------------------------------------------------------------------------------------


function selectNav(form) {
        var index = form.select1.selectedIndex
        if (form.select1.options[index].value != "0") {
       	 location=form.select1.options[index].value;}
}

//------------------------------------------------------------------------------------------------------------------------------------
// Used on safeconow/Business_Insurance/Supporting_Services_and_Information/RiskServices/faqs.aspx

function showHide(id) {

  var navbar = document.getElementById(id);   

      subs = new Array();  
      subs[0] = document.getElementById('q1');
      subs[1] = document.getElementById('q2');
      subs[2] = document.getElementById('q3');
      subs[3] = document.getElementById('q4');
      subs[4] = document.getElementById('q5');
      subs[5] = document.getElementById('q6');
      subs[6] = document.getElementById('q7'); 
  
      for(i=0; i<subs.length; i++) {     
          if(navbar == subs[i] && subs[i].style.display !="inline"){  
              subs[i].style.display="inline";            
			} else { 
			  subs[i].style.display="none";
			}
	     }   
    }
// --------------------------------------------------------------------------------------------------------//--------------------------------------------------------------------------------------------------------- //  Purpose: Function is used by leftNav dropdown controls.
//                 
//
    function dropDownSelect(id) {

  // id is the selectedIndex.value passed from dropdown control   
  // selected index.value will be a url i.e.  /safecnow/business_insurance/auto.asp 
  // or javascript:openWindow('http://www.safeco.com/riskservices')
  //  these are set in  /safeconow/xml/ folder       

indexString = new String(id);    

sn_Check = new RegExp("javascript", "i");   // create reqexp to compare to indexstring

results = indexString.match(sn_Check); // returns null if empty or javascript 
      
if(results == null || results =="" ) {    // open in same window in no match 

location.href = id;  // open in same window  

} else{     // we have a match open in a new window                    

splitString = indexString.split("('");    // 2 string splits reformat the string and pass it openWindow function
splitString = splitString[1].split("')");

openWindow(splitString[0]);

  }
}
//----------------------------------------------------------------------------------------------------------------
// called from /safeconow/Business_Insurance/market_focus_quide/default.aspx
//

 function linkTo(id) { 
 
  var wotamiEnvironment = "Development"; 
  var pdfName = id;
 	 
	url = "/safeconow/Business_Insurance/market_focus_quide/mf_pdfGuides/";
	url += pdfName;

      window.open(url, 'NewWindow', 'status=yes,location=no,directories=no,scrollbars=yes,toolbar=no,menubar=no,resizable,width=800,height=600,left=50, top=50');
 }
//--------------------------------------------------------------------------------------------------

// called from /safeconow/resources/contact_us/personal.aspx


 function foo(id)
   {
      var navbar = document.getElementById(id);   

      subs = new Array();  
      subs[0] = document.getElementById('q1');
      subs[1] = document.getElementById('q2');
      subs[2] = document.getElementById('q3');
      subs[3] = document.getElementById('q4');
      subs[4] = document.getElementById('q5');
      subs[5] = document.getElementById('q6');
      subs[6] = document.getElementById('q7');
      subs[7] = document.getElementById('q8');
      subs[8] = document.getElementById('q9');  
	     subs[9] = document.getElementById('q10');  
  
      for(i=0; i<subs.length; i++) {     
          if(navbar == subs[i] && subs[i].style.display !="inline"){  
              subs[i].style.display="inline";            
			} else { 
			  subs[i].style.display="none";
			}
	     }   
    }

// --> 
 