function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function P7_JumpMenu(selObj,restore){ //v1.4 by Project Seven
	var theFullString = selObj.options[selObj.selectedIndex].value;
	if (restore) selObj.selectedIndex=0;
	var theLength = theFullString.length;
	var endPos = theFullString.lastIndexOf("~");
	var theUrl, theTarget, theParent;
	if (endPos > 0) {theUrl = theFullString.substring(0,endPos);}
	else {theUrl = theFullString;}
	endPos++
	if (endPos < theLength) {theTarget = theFullString.substring(endPos,theLength)}
	else {theTarget = "window:Main";}
	if (theTarget == "window:New") {window.open(theUrl);}
	else if (theTarget == "window:Main") {eval("parent.location='"+theUrl+"'");}
	else {eval("parent.frames[\'"+theTarget+"\'].location='"+theUrl+"'");}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 1 * 60 * 60 * 1000));
//var _gaq = _gaq || [];
//_gaq.push(['_setAccount', 'UA-2248576-1']);
//_gaq.push(['_trackPageview']);
//_gaq.push(['_setDomainName', 'winltd.com']);
//_gaq.push(['_setAllowLinker', false]);

//(function () {
//    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
//    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
//    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
//})();

function getCookieVal(offset){
	var endstr = document.cookie.indexOf(';', offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

function FixCookieDate(date){
	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0) date.setTime(date.getTime() - skew);
}

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 null;
}

function SetCookie(name, value, expires, path, domain, secure){
	document.cookie = name + '=' + value + 
	((expires)?'; expires=' + expires.toGMTString():'') + 
	((path)?'; path=' + path:'') + 
	((domain)?'; domain=' + domain:'') + 
	((secure)?'; secure=' + secure:'');
}

function DeleteCookie(name,path,domain){
	if(GetCookie(name)){
		document.cookie = name + '=' + 
		((path)?'; path=' + path:'') + 
		((domain)?'; domain=' + domain:'') + 
		'; expire= Thu, 01-Jan-70 00:00:01 GMT';
	}
}

function LTrim(str) { 
 for (var i=0; str.charAt(i)<=" "; i++); 
 return str.substring(i,str.length); 
} 

function RTrim(str) { 
 for (var i=str.length-1; str.charAt(i)<=" "; i--); 
 return str.substring(0,i+1); 
} 

function Trim(str) { 
 var allSpace = true;
 for (var i = 0; i < str.length; i++) if(str.charAt(i)>" ") allSpace = false;
 return (allSpace)?'':LTrim(RTrim(str)); 
} 

function format(expr, decplaces){
	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));
	while (str.length <= decplaces){
		str = "0" + str
	}
	var decpoint = str.length - decplaces;
	var strBeforeDec = str.substring(0,decpoint);
	var strTemp = "";
	var j = 0;
	//alert(strBeforeDec);
	for (var i = strBeforeDec.length - 1; i >= 0; i--){
		strTemp = strBeforeDec.charAt(i) + strTemp;
		j++;
		if (j == 3){
			strTemp = "," + strTemp;
			j = 0;
		}
	}
	//alert(strBeforeDec + "," + strTemp);
	if (strTemp != ""){
		if (strTemp.charAt(0) == ",") strTemp = strTemp.substr(1) 
		strBeforeDec = strTemp;
	}
	return strBeforeDec + "." + str.substring(decpoint, str.length);
}

