function CallPrint(panel)
{
    var prtContent = document.getElementById(panel);
    var WinPrint = window.open(null,null,"left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0");
    WinPrint.document.write(prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    WinPrint.close();
    prtContent.innerHTML=strOldOne;
}
//////////////////////////////////////////////////////////////////////////////
// THE FOLLOWINGS ARE ...
// ** DEPRECATED **

// set the base font sizes you want for each of the four letter A's here
var textSizeBaseSetting = new Array("70%","80%","90%","100%");

// rollover image code
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_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_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];}
}

function popupGallery (img, myname, w, h) {
	var popupWin;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	w = w + 20;
	h = h + 20;
	var settings="height="+h+",width="+w+",top="+wint+",left="+ winl +",scrollbars=auto,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no";
	
 	popupWin=window.open(img,myname,settings);	
}

//////////////////////////////////////////////////////////////////////////////
// USER PREFS AND COOKIE CODE

// ** DEPRECATED **
/*
var cookiesEnabled = areCookiesEnabled();

var	contrastChoiceCSS = "";
// get the contrast based on cookie
var userPrefContrast = getCookie("contrastChoice");
if (userPrefContrast.length > 0) 
{
	contrastChoiceCSS = "<link href=\"/css/" + userPrefContrast + ".css\" rel=\"stylesheet\" type=\"text/css\" />";	
}
*/


function getUserPrefsFn() {
	// get the textsize based on cookie
	var userPrefTextsize = getCookie("textsizeChoice");
	if (userPrefTextsize.length >  0) {
		setTextsizeChoiceFn(userPrefTextsize);
	} else {
		// if no cookie set, use default
		setTextsizeChoiceFn(2);
	}
}

// set the contrast cookie
function contrastChoiceSetFn(contrastChoice) {
	if (cookiesEnabled == true) {
		setCookie ("contrastChoice", contrastChoice, getExpDate(3650, 0, 0));
		location.reload();
	} else {
		alert("You must have browser cookies enabled to use this feature.");
	}
}


// resize the text, change the selected "A" and set a cookie
function textsizeChoiceFn(Choice){
	if (cookiesEnabled == true) {
		setCookie ("textsizeChoice", Choice, getExpDate(3650, 0, 0));
		setTextsizeChoiceFn(Choice);
	} else {
		alert("You must have browser cookies enabled to use this feature.");
	}
}

function setTextsizeChoiceFn(Choice) {
		document.body.style.fontSize = textSizeBaseSetting[Choice - 1];
		setToolbarSelection(Choice);
}

/**
* This is a function that sets the proper image highlight by resetting the src
* and disablng the mouseover behaviour while selected
*/


function setToolbarSelection(Choice) {
	if (Choice == 1){
		document["textChoice10"].src="/images/shared/img_A_10pt_on.jpg";
		document["textChoice12"].src="/images/shared/img_A_12pt.jpg";
		document["textChoice14"].src="/images/shared/img_A_14pt.jpg";
		document["textChoice16"].src="/images/shared/img_A_16pt.jpg";
	}

	 if (Choice == 2) {
		document["textChoice12"].src="/images/shared/img_A_12pt_on.jpg";
		document["textChoice10"].src="/images/shared/img_A_10pt.jpg";
		document["textChoice14"].src="/images/shared/img_A_14pt.jpg";
		document["textChoice16"].src="/images/shared/img_A_16pt.jpg";
	}

	if (Choice == 3){
		document["textChoice14"].src="/images/shared/img_A_14pt_on.jpg";
		document["textChoice10"].src="/images/shared/img_A_10pt.jpg";
		document["textChoice12"].src="/images/shared/img_A_12pt.jpg";
		document["textChoice16"].src="/images/shared/img_A_16pt.jpg";
	}

	if (Choice == 4){
		document["textChoice16"].src="/images/shared/img_A_16pt_on.jpg";
		document["textChoice10"].src="/images/shared/img_A_10pt.jpg";
		document["textChoice14"].src="/images/shared/img_A_14pt.jpg";
		document["textChoice12"].src="/images/shared/img_A_12pt.jpg";
	}
}



// utility function to retrieve an expiration date in proper
// format; pass three integer parameters for the number of days, hours,
// and minutes from now you want the cookie to expire (or negative
// values for a past date); all three parameters are required,
// so use zeros where appropriate
function getExpDate(days, hours, minutes) {
    var expDate = new Date( );
    if (typeof days == "number" && typeof hours == "number" && typeof hours == "number") {
        expDate.setDate(expDate.getDate( ) + parseInt(days));
        expDate.setHours(expDate.getHours( ) + parseInt(hours));
        expDate.setMinutes(expDate.getMinutes( ) + parseInt(minutes));
        return expDate.toGMTString( );
    }
}


// utility function called by getCookie( )
function getCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1) {
        endstr = document.cookie.length;
    }
    return unescape(document.cookie.substring(offset, endstr));
}
   
// primary function to retrieve cookie by name
function getCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg) {
            return getCookieVal(j);
        }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
    }
    return "";
}
   
  // store cookie value with optional details as needed
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
   
// remove the cookie by setting ancient expiration date
function deleteCookie(name,path,domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}




// check to see if browser accepts cookies
function areCookiesEnabled() {
	var cookieEnabled = false;
	if (typeof document.cookie == "string") {
    	if (document.cookie.length == 0) {
        document.cookie = "test";
        cookieEnabled = (document.cookie == "test");
        document.cookie = "";
    	} else {
        	cookieEnabled = true;
    	}
	}
	return cookieEnabled;
}

//document.write(contrastChoiceCSS);