//window pop up
function popWindow(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h-200) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes';
	win = window.open(mypage, myname, winprops);
}


function getexpirydate(nodays)
{
	var UTCstring;
	Today = new Date();
	nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}

function getcookie(cookiename) 
{
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf(cookiename);
	if (index1==-1 || cookiename=="") return ""; 
	var index2=cookiestring.indexOf(';',index1);
	if (index2==-1) index2=cookiestring.length; 
	return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}

function setcookie(name,value,duration)
{
	cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
	document.cookie=cookiestring;
	if(!getcookie(name))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function isIEE()
{  
	var strBrwsr = navigator.userAgent.toLowerCase();  
	if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0)
	{    
		return true;  
	}
	else
	{    
		return false;  
	}
}

function fnWriteForIE(divName)
{
	if (isIEE() == true)
	{
//		var sLogin = document.getElementById("login").innerHTML;
//		document.getElementById("login").innerHTML = sLogin;
		
//		var sNav = document.getElementById("nav").innerHTML;
//		document.getElementById("nav").innerHTML = sNav;

	    if (document.getElementById(divName))
	    {
	        var sTemp = document.getElementById(divName).innerHTML;
	        document.getElementById(divName).innerHTML = sTemp;
	    }
	}
}

function fnJumpToItem(base,item)
{
	var sItem = item;
	var sBase = base;
	if (sItem.length != 0)
	{
		document.location.href = sBase + '#' + item;
	}
}

function photoSwap(who,newImg) 
	{
		document.getElementById(who).setAttribute('src', newImg);
	}

function fnSetBreadcrumbLink(reference,matcher)
{
	var x = reference;

	for (i=0;i<x.length;i++)
	{
		//alert(x.options[i].text);
		if(x.options[i].text == matcher);
		{
			alert(x.options[i].text + "  =  " + matcher);
		}
	}
}