<!--Begin Pro js functions
function isdefined( variable)
{
    return (typeof(variable) == "undefined")?  false: true;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// End Pro js functions -->
<!--
var isdynamic = true;
function open_link(contenttype, object, language){
	s= window.location.href;
	page = "index.cfm?contentid=" + object;
	document.location.href = page;
}

function open_popup(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'left=300,top=10,width=700,height=650,scrollbars=yes,resizable=0,status=yes,menubar=no,directories=np');
}

function open_pictman(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminPictures', 'left=300,top=10,width=650,height=450,scrollbars=no,resizable=0,status=yes,menubar=no,directories=np');
}

function gotoAnchor(anchorname) {
	document.location.hash = anchorname;
	void(0);
}
function confirm_action (page){
	if (confirm("Are you sure you want to do this ?")) {
		page = page + "&rd=" + Math.random();
		open_popup (page, 'adminConsole', 'left=300,top=10,width=700,height=300,scrollbars=yes,resizable=1,status=no,menubar=no,directories=np');
		return false;}
	else {
		return false;
	}
}

function setCookie(name, value, expire) 
{   
    document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function saveLanguage(name) 
{
    var today = new Date();
    var expires = new Date();
    expires.setFullYear(today.getFullYear() + 1);
    setCookie("pro", name, expires);
}


function getCookie(Name)
{
    var search = Name + "=";
    if (document.cookie.length > 0)
    { // if there are any cookies
        offset = document.cookie.indexOf(search);
        if (offset != -1)
        { // if cookie exists
            offset += search.length;
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1)
            {
                end = document.cookie.length;
            }
	    return unescape(document.cookie.substring(offset, end));
	}
    }
}


function popUp(url)
{ 
    sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
    self.name = "mainWin";
}


var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);

function printThisPage(nb) {

	if(isdefined(document.forms["printForm"])){	
   		window.open("","PrintCustom",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=800,height=600');
		document.forms["printForm"].submit();
	}else{
		window.open("print.cfm","Print",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=620,height=600');
	}
}
function exportThisPage(format) {

	if ( isdefined(document.forms["exportForm"]) ) {	
		//window.open("","ExportCustom",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=800,height=600');
		var oldAction = document.forms["exportForm"].action;
		var oldTarget = document.forms["exportForm"].target;
		document.forms["exportForm"].action = document.forms["exportForm"].action + '&export=' + format;
		document.forms["exportForm"].target = "";
		document.forms["exportForm"].submit();
		document.forms["exportForm"].action = oldAction;
		document.forms["exportForm"].target = oldTarget;
	} else {
		window.open("export.cfm","Export",'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=620,height=600');
	}
}

function xlsThisPage(content, type, connected, onlyonetab) {
	if(connected)
	{
		var old_export=$("input#TabToExport").val();
		if((content=="Performances") && (onlyonetab!="true"))
		{
			
			$("input#TabToExport").attr("value", "global");
		}
	
		if(isdefined(document.forms["xlsForm"])){	   		
			document.forms["xlsForm"].submit();
		}
		$("input#TabToExport").attr("value", old_export);
	}
}

function printThisInitiativePage(page){
	page = page + "&rd=" + Math.random();
	window.open (page, 'adminConsole', 'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=620,height=600');
}

function printThis() {
  if (pr) { // NS4, IE5
    window.print();
  } else if (da && !mac) { // IE4 (Windows)
    vbPrintPage();
  } else { // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  }
}


	

	function selectValue(selectbox) {
		var form = selectbox.form;
		form.criteria.value = selectbox.name;
		form.submit();
	}

	function announceEvent(form, eventname) {
		form.method.value = eventname;
		form.submit();
	}

	function getPortfolio(id,form) {
		form.portfolioid.value = id;
		form.submit();
	}
	
	function getAccount(portfolioid,accountid,form) {
		form.portfolioid.value = portfolioid;
		form.accountid.value = accountid;
		form.action.value = 'accountdetail';
		form.submit();
	}
	
	function getAccountSecurities(portfolioid,title,form) {
		form.portfolioid.value = portfolioid;
		form.securitiesFilter.value = title; 
		form.action.value = 'accountsecurities';
		form.submit();
	}
	
	function getDateDiff(strDteFirst,strDteLast) {
		intDteFirst = parseInt( strDteFirst );
		intDteLast  = parseInt( strDteLast );
		result = intDteLast - intDteFirst;
		return result;
	}
	function verifyHiddenDates(fldDateFirst, fldDateLast, strMsgError ) {
		flgResult = (getDateDiff(fldDateFirst.value, fldDateLast.value) >= 0);
		
		if (!flgResult) {
			alert(strMsgError);
		}
		return flgResult;
	}
	function updateHiddenFields(){
		document.forms['portfolioListForm'].date_from.value = document.forms['portfolioListForm'].from_year.options[document.forms['portfolioListForm'].from_year.selectedIndex].value;
		document.forms['portfolioListForm'].date_from.value += document.forms['portfolioListForm'].from_month.options[document.forms['portfolioListForm'].from_month.selectedIndex].value;
		document.forms['portfolioListForm'].date_from.value += document.forms['portfolioListForm'].from_day.options[document.forms['portfolioListForm'].from_day.selectedIndex].value;
		document.forms['portfolioListForm'].date_to.value = document.forms['portfolioListForm'].to_year.options[document.forms['portfolioListForm'].to_year.selectedIndex].value;
		document.forms['portfolioListForm'].date_to.value += document.forms['portfolioListForm'].to_month.options[document.forms['portfolioListForm'].to_month.selectedIndex].value;
		document.forms['portfolioListForm'].date_to.value += document.forms['portfolioListForm'].to_day.options[document.forms['portfolioListForm'].to_day.selectedIndex].value;
	}
	function updateSearchField(form,str){
		if(form.searchstring.value.indexOf(str) == 0){
			form.searchstring.value = '';
		}
		
	}
//-->


