/* ----------------------------------------------
	open_functions.js - included on all templates	
---------------------------------------------- */

// Main pop up function	
	var newMedia = null;
	function openWindow(url, features, name) { // name is optional	
		var windowName = 'newMedia';
		if (name != ""){
			windowName = name;	
		}
		if (newMedia && document.all) { // if window object is present and IE browser
			newMedia.close();									
			newMedia = window.open(url, windowName, features);			
			try { newMedia.focus(); } catch(e) {} // catches IE/Reader 7.0 error							
		} else { // Not IE or no window object present	
			newMedia = window.open(url, windowName, features);
			try { newMedia.focus(); } catch(e) {}												
		}
		return;		
	}	
		
	function mediaWin(url) {			
		openWindow(url, "dependent=no,height=450,width=525,resizable=yes,scrollbars=yes,toolbar=yes");
	}
	
	function mediaWinDefine(url,strFeatures) {	
		openWindow(url, strFeatures);	
	}
	
	function largeMediaWin(url) {
		openWindow(url, "dependent=no,resizable=yes,scrollbars=yes,toolbar=yes");		
	}	
	
	function superMediaWin(url,urlNext) {
		openWindow(url, "dependent=no,height=450,width=525,resizable=yes,scrollbars=yes,toolbar=yes");				
		document.location.href = urlNext;
	}
			
	function sizeWin(url, hght, wdth) {
		openWindow(url, "dependent=no,height=" + hght + ",width=" + wdth + ",resizable=yes,scrollbars=no,toolbar=yes,menubar=yes");
	}	
	
	function sizeWinChromeless(url, hght, wdth) {
		openWindow(url, "dependent=no,height=" + hght + ",width=" + wdth + ",resizable=yes,scrollbars=no,toolbar=no,menubar=no");
	}
	
	function sizeWinScroll(url, hght, wdth) {		
		openWindow(url, "dependent=no,height=" + hght + ",width=" + wdth + ",resizable=yes,scrollbars=auto,toolbar=yes");		
	}	
	
	function largeWin(url) {
		openWindow(url, "dependent=no,resizable=yes,scrollbars=yes,toolbar=yes");					
	}	
	
	function fncWindow(url) {
		openWindow(url, "");						
	}	
	
	function fncWindowName(url, name) {
		openWindow(url,"", name);						
	}	
	
// Port Opt Window
	function portOptWin(url) {	
		openWindow(url, "dependent=no,height=450,width=525,resizable=yes,scrollbars=yes,toolbar=yes", 'port_opt');	
	}

// Pacific Funds Calculator
	function pfCalcWin(url) {
		openWindow(url, "dependent=no,height=450,width=550,resizable=yes,scrollbars=yes,menubar=yes", 'pfCalc');		
	}

// 529 Flash Window
	function flash529(url) {
		openWindow(url, "dependent=yes,height=288,width=612,resizable=yes,scrollbars=yes,toolbar=yes", 'mediaFlash');		
	}
	
	function fnc529Value(){
		strUrl = strUrl.toLowerCase();
		var str529Value = "$262,000"
		if((strUrl.indexOf("product=mt") != -1) || (strUrl.indexOf("/montana/") != -1)){
			str529Value = "$262,000";
		}
		return str529Value;
	}
	
// confcall pop up 
	function confcallpop(url) {
		openWindow(url, "dependent=no,height=400,width=700,resizable=no,scrollbars=no,toolbar=no,menubar=yes", 'tempFlash');		
	}
	
// changes the target to _top	
	function targetTop(url) {
		parent.top.location.href = url;
	}	

	function popUp(theurl) {
		openWindow(theurl, "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=550,height=500,top=20,left=20");
	}
	
	function popFull(theurl, name) {
		openWindow(theurl, "toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600,top=60,left=60", name);	
	}
	
	function popPQ(theurl) {
		openWindow(theurl, "dependent=no,height=450,width=525,resizable=yes,scrollbars=yes,toolbar=no", 'mag');		
	}
	
// multimedia pop up 	
	function mtvMediaWin(url) {	
		openWindow(url, "dependent=no,height=500,width=700,resizable=no,scrollbars=no,toolbar=no", 'mag');		
	}

// full page ad pop up 
	function showAd() { // launched from flash billboard - temporary
			sizeWin('/public/promotions/full_page_flash/popup_ad.html', '385', '598');
	}

	
// Pacific Quarterly Mag
	function magWin(url) {
		openWindow(theurl, "dependent=no,height=450,width=525,resizable=yes,scrollbars=yes,toolbar=yes", 'mag');			
	}
	
// Tax Document Help pages
	function popUpTaxDoc(url) {
	    window.open(url,'mediaWin','menubar=no,toolbar=no,status=yes,resizable=1,scrollbars=yes,maximize=no,width=720,height=500');
	    return;  
	}
// Media
	function window_focus_to_master(url){
		master= window.opener
	
	
		if (master.closed){
			window.close()
			window.open(url)
		}
		else {
			master.location.href = url
			master.location.reload
			window.close('large')
			//window.open(url)
		}
	}		
	
	
// global variables
 	var strArrow;						//repeated on /registration/getting_appointed.html
	var strArrowSup;
	var strBullet;						//repeated on /registration/getting_appointed.html
	var strBulletTop;					//repeated on /registration/getting_appointed.html
	var strCompany;						//repeated on /registration/getting_appointed.html
	var strPhone;						//repeated on /registration/getting_appointed.html
	var strDivision;
	var strLogo;
	var strCorporateUrl;
	var strManagerNumber;
	var strAssetClasses = "";
	var strFundNumber;
	var strFundNumberMinusPortOpt = "14";		//this is for mutual funds when specifying fund number without port opt funds
 	var strUrl = window.location.href;
	var str529MaxValue = fnc529Value("");	//Pacific Funds 529 maximum value
	var str529MaxValueMT = "$262,000";			//used to call from Arizona compare sheets
	
	if(strUrl.indexOf("http:") != -1 || strUrl.indexOf("myaccount") != -1){
		strArrow = '<IMG WIDTH="17" HEIGHT="14" SRC="/images/general/arrow_drkgrey.gif">';
		strBullet = '<IMG WIDTH="7" HEIGHT="12" SRC="/images/general/bullet_padded_ann.gif">';
		strBulletShort = '<IMG WIDTH="7" HEIGHT="7" SRC="/images/general/bullet_drkgrey.gif">';
		strPhone = "(800) 722-4448";
	}else{
		strArrow = '<IMG WIDTH="17" HEIGHT="14" SRC="/images/general/arrow_drkgrey.gif">';
		strBullet = '<IMG WIDTH="7" HEIGHT="12" SRC="/images/general/bullet_padded_ann.gif">';
		strBulletShort = '<IMG WIDTH="7" HEIGHT="7" SRC="/images/general/bullet_drkgrey.gif">';
	}
	
	if (strUrl.indexOf("pacificlifeandannuity") > -1){
		strArrowSup = '<IMG WIDTH="17" HEIGHT="17" SRC="/images/general/arrow_drkgrey_sup.gif">';
		strCompany = "Pacific Life &amp; Annuity";
		strPhone = "(800) 748-6907";
		strDivision = "";
		strLogo = "<IMG BORDER=0 WIDTH=252 HEIGHT=45 SRC=/panda/images/logos/logo_panda_color.gif>";
		strCorporateUrl = "www.PacificLifeandAnnuity.com";
		strManagerNumber = "18";
		strFundNumber = "32";
		
	} else if((strUrl.indexOf("mutualfunds") > -1) || (strUrl.indexOf("collegesavings") > -1)){
		strArrowSup = '<IMG WIDTH="17" HEIGHT="17" SRC="/images/general/arrow_drkgrey_sup.gif">';
		strCompany = "Pacific Life Funds";
		strPhone = "(800) 722-2333";
		strDivision = "";
		strLogo = "<IMG BORDER=0 WIDTH=250 HEIGHT=25 SRC=/mutual_funds/images/general/logo_pacific_funds.gif>";
		strCorporateUrl = "www.PacificLife.com";
		strManagerNumber = "11";
		strAssetClasses = "11";
		strFundNumber = "19";
		strFundNumberMinusPortOpt = "14";
		
	} else {
		strArrowSup = '<IMG WIDTH="17" HEIGHT="17" SRC="/images/general/arrow_drkgrey_sup.gif">';
		strCompany = 'Pacific Life';
		if(strUrl.indexOf("http:") != -1 || strUrl.indexOf("myaccount") != -1){
			strPhone = "(800) 722-4448";
		} else {
			strPhone = "(800) 722-2333";
		}			
		strDivision = "Annuities Division";
		strLogo = "<IMG BORDER=0 WIDTH=227 HEIGHT=34 SRC=/images/top_nav/logo_pl_2clr.gif>";
		strCorporateUrl = "www.PacificLife.com";
		strManagerNumber = "18";
		strFundNumber = "32";
	}
	
	function fncCopyYear(){
		var today = new Date(); 
		var strCopyYear = today.getFullYear();
		document.write(strCopyYear);
	}



