<!--hide this script from non-javascript-enabled browsers

/* Functions that swap images. */
function WebswapImage() 
{ 
	var i,j=0,x,a=WebswapImage.arguments; 
	document.Websr=new Array; 
	if(document.getElementById)
	{
		for(i=0;i<(a.length-2);i+=3)
		{
	   		if ((x=document.getElementById(a[i]))!=null)
			{
				document.Websr[j++]=x; if(!x.oSrc) x.oSrc=x.src; 		
				x.src=a[i+2];
			}
		}
	}
}
function WebswapImgRestore() 
{ 
  	var i,x,a=document.Websr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function WebpreloadImages() 
{ 
	var d=document; 
	if(d.images)
	{ 
		if(!d.Webp) d.Webp=new Array();
   		var i,j=d.Webp.length,a=WebpreloadImages.arguments; 
		for(i=0; i<a.length; i++)
		{
   			if (a[i].indexOf("#")!=0)
			{ 
			d.Webp[j]=new Image; 
			d.Webp[j++].src=a[i];
			}
		}
	}
}

// this is no frames version
function WebberyMenu(targ,selObj,restore)
{ 
    var extra="";
	var save;
	var uid=0;
	if(targ)
	{
        uid = getUID();
        if(uid !=0)
        {
		    extra = "?UID=";
            extra += uid;
        }
		save=selObj.selectedIndex;
		selObj.selectedIndex=restore;
		eval(targ+".location='"+selObj.options[save].value+extra+"'");
	}
}
// This example is from JavaScript: The Definitive Guide, 3rd Edition.
// That book and this example were Written by David Flanagan.
// They are Copyright (c) 1996, 1997, 1998 O'Reilly & Associates.
// This example is provided WITHOUT WARRANTY either expressed or implied.
// You may study, use, modify, and distribute it for any purpose,
// as long as this notice is retained.

/*
 * This function parses ampersand-separated name=value argument pairs from
 * the query string of the URL. It stores the name=value pairs in 
 * properties of an object and returns that object.
 */
function getArgs() {
    var args = new Object();
    var query = location.search.substring(1);  // Get query string.
    var pairs = query.split("&");              // Break at comma.
    for(var i = 0; i < pairs.length; i++) {
	var pos = pairs[i].indexOf('=');       // Look for "name=value".
	if (pos == -1) continue;               // If not found, skip.
	var argname = pairs[i].substring(0,pos);  // Extract the name.
	var value = pairs[i].substring(pos+1); // Extract the value.
	args[argname] = unescape(value);          // Store as a property.
    }
    return args;                               // Return the object.
}

function checkUID() 
{
    var position = location.search.search(/UID/i);  // Get position of the UID string
	var UID =0;
	var UIDString="UID=";
	var newString;
	if(position>0)
	{
		UID=getUID();
	}
    if(position<0 || UID==0)
	{
		// look if a cookie has been stored
		var allcookies=document.cookie;
		position=allcookies.indexOf(UIDString);
		var start=position+UIDString.length;
		var end=allcookies.indexOf(";", start);
		if(end<0)
		{
			end=allcookies.length;
		}
		if(end>0)
		{
			UID=allcookies.substring(start, end);
			newString = "?UID="+UID;
			if(UID>0)
			{
				location.replace(location.pathname+newString);
			}
		}

	}
	if(position<0 ||UID==0)
	{
		// find a suitable UID
		UID = Math.random()*100000000;
		UID=Math.ceil(UID);
		if(UID>0)
		{
			newString = "?UID="+UID;
			location.replace(location.pathname+newString);
			// store the new UID value as a cookie
			var nextYear=new Date();
			nextYear.setFullYear(nextYear.getFullYear()+1);
			document.cookie=UIDString+UID+"; expires="+nextYear.toGMTString()+"; path=/";
		}

	}
	return UID;
}

function checkSSL() 
{
	var secure="https:";
	var protocol = location.protocol;
	var url=location.href;
	var newurl;
	// don't do this if working on localhost
	if(url.search(/localhost/i)<0)
	{
		if(protocol != secure)
		{
		// replace the protocol part of the URL
			newurl = url.replace(protocol, secure);
			location.replace(newurl);		
		}
	}
	return;
}
function getUID() 
{
    var position = location.search.search(/UID/i);  // Get position of the UID string
	var UID=0;
    if(position>0)
	{
		// find a suitable UID
		var query = location.search.substring(1);  // Get query string.
		var pairs = query.split("&");              // Break at ampersand.
		for(var i = 0; i < pairs.length; i++) 
		{
			var pos = pairs[i].indexOf('=');       // Look for "name=value".
			if (pos == -1) continue;               // If not found, skip.
			var argname = pairs[i].substring(0,pos);  // Extract the name.
			var value = pairs[i].substring(pos+1); // Extract the value.
			if(argname=="UID")
			{
				UID=unescape(value);
				break;
			}
		}
	}
	return UID;
}

var success=-1;

function getSuccess() {
    var position = location.search.search(/success/i);  // Get position of the UID string
    if(position>0)
	{
		// find a suitable UID
		var query = location.search.substring(1);  // Get query string.
		var pairs = query.split("&");              // Break at comma.
		for(var i = 0; i < pairs.length; i++) 
		{
			var pos = pairs[i].indexOf('=');       // Look for "name=value".
			if (pos == -1) continue;               // If not found, skip.
			var argname = pairs[i].substring(0,pos);  // Extract the name.
			var value = pairs[i].substring(pos+1); // Extract the value.
			if(argname=="success")
			{
				success=unescape(value);
			}
		}
	}
	return success;
}

function reDo()
{ 
	window.location.reload(false); 
}

// -->


