// no expiry date, cookie should be trashed on closing browser
function SetCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0)
		document.cookie = cookieName+"="+escape(cookieValue)+";";
	else
	{
		expire.setTime(today.getTime() + 3600000*24*nDays);
		document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
	}
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}


function HideContent(d) 
{
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "none";
}

function HideContentMultiple(id_array)
{
	for (i = 0; i < id_array.length; i++)
	if (id_array[i].length > 0)
		document.getElementById(id_array[i]).style.display = "none";
}

function ShowContent(d) 
{
	if(d.length < 1) { return; }
	document.getElementById(d).style.display = "block";
}

function SwitchContent(curcont, choice) 
{
	curdiv = document.getElementById(curcont);
	curdiv.style.display = 'none';
	newdiv = document.getElementById(choice);
	newdiv.style.display = 'block';
	curcont = choice;
	return;
}

function SetContent(curcont) {

	if (document.getElementById(curcont)) {
		curdiv = document.getElementById(curcont);
		curdiv.style.display = 'block';
	}

	return;

}


function print_it(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}

jQuery.noConflict;

$(document).ready(function() {

	if(jQuery.browser.msie && jQuery.browser.version.substr(0,1)<="7") {
		jQuery("div img").pngFix($);
	}
});
