<!--//
var isIE;
if (navigator.appName == "Microsoft Internet Explorer") {
	isIE = true;
}
if (navigator.appName == "MSIE") {
	isIE = true;
}
function loadMovie(src,h,w,fvars) {
	var text = "";
	if (isIE) {
		text	 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		text	= text + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0" ';
		text	= text + 'width="' + w + '" height="' + h + '">';
		text = text + '<param name="movie" value="' + src + '" />';
		text = text + '<param name="allowScriptAccess" value="sameDomain" />';
		text = text + '<param name="wmode" value="transparent" />';
		text = text + '<param name="quality" value="high" />';
		if (fvars.length > 0) {
			text = text + '<param name="FlashVars" value="' + fvars + '" />';
		}
		text = text + '</object>';
	} else {
		text	= '<embed src="' + src + '" ';
		text	= text + 'quality="high" ';
		text	= text + 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ';
		text	= text + 'type="application/x-shockwave-flash" ';
		text	= text + 'width="' + w + '" height="' + h + '" ';
		text	= text + 'allowscriptaccess="samedomain" ';
		text	= text + 'wmode="transparent"';
		if (fvars.length > 0) {
			text	= text + ' flashvars="' + fvars + '"';
		}		
		text	= text + '></embed>';
	}
	//alert(text);
	document.write(text);
}

function targetLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "internal") {
			anchor.target = "_top";
		}
	}
}
window.onload = targetLinks;

function changeCase(frmObj) {
	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	tmpStr = frmObj.value.toLowerCase();
	strLen = tmpStr.length;
	if (strLen > 0)  {
		for (index = 0; index < strLen; index++)  {
			if (index == 0)  {
				tmpChar = tmpStr.substring(0,1).toUpperCase();
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			} else {
				tmpChar = tmpStr.substring(index, index+1);
				if (tmpChar == " " && index < (strLen-1))  {
					tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
				}
			}
		}
	}
	frmObj.value = tmpStr;
}
function changeLower(frmObj) {
	var tmpStr;
	tmpStr = frmObj.value.toLowerCase();
	frmObj.value = tmpStr;
}
function changeUpper(frmObj) {
	var tmpStr;
	tmpStr = frmObj.value.toUpperCase();
	frmObj.value = tmpStr;
}

// Set the session for click from associated sites
var qs = location.search.substring(1);
if (qs.length > 1) {
	var ary = location.search.substring(1).substring(1).split("&");
	for (var i=0,n=ary.length; i<n; i++) {
		var fname = ary[i].split("=")[0];
		var fvalue = ary[i].split("=")[1];
		if (fname == "essid" && fvalue.length>5) {
			document.cookie = 'sessid=' + escape(fvalue) + '; path=/';
		}
	}
}