
var pageIncreaseHeight = 0;
var pageIncreaseWidth = 0;

jQuery(document).ready(

		function(){
			// set up rollover on IMG
			jQuery("img.rollover").hover(
				function(){
					this.src = this.src.replace("_off","_on");
				},
				function(){
					this.src = this.src.replace("_on","_off");
				}
			);

			jQuery(".toBegin").mousedown(function() {
				jQuery.scrollTo(0, 1200, {
					queue : true
				});
				return false;
			}
			);
		}

);

function initPopupSizeDebug(increaseWidth,increaseHeight){

	var div = "<div id='status' style='position: absolute; top: 0px; left 0px; color: white; background-color: red;'></div>";
	jQuery("body").append(div);
	
    jQuery(window).resize(function() {

        var w = jQuery(window).width();
        var h = jQuery(window).height();
        var status = "Width: " + w + "px, Height: " + h + "px";
        status = status + " IncX: " + increaseWidth + "px, IncY: " + increaseHeight + "px";
        status = status + " Set Width to " + (w - increaseWidth) + "px Height to " + (h - increaseHeight) + "px";
        var divW = jQuery("#PreloaderContainer").width();
        if (divW != null){
            var divH = jQuery("#PreloaderContainer").height();
        	status = status + " Inner Width: " + divW + "px, Inner Height: " + divH + "px";
        }

        jQuery("#status").text(status);
    });

	initPopupSize(increaseWidth,increaseHeight);
	
}

function initPopupSize(increaseWidth,increaseHeight){
	
	var buttonsHeight = 25;
//	var buttonsHeight = aqflash_button_bar.offsetHeight;

	pageIncreaseHeight = increaseHeight + buttonsHeight;
	pageIncreaseWidth = increaseWidth;
	
}

function initPopupSizeNoButtons(increaseWidth,increaseHeight){
	
	pageIncreaseHeight = increaseHeight;
	pageIncreaseWidth = increaseWidth;
	
}

function popUP(mypage, myname, w, h, scroll, titlebar){
	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	
	alert(winprops);
	
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}

}

function preloadImages() { // v3.0

	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	
}

function gup( name ){
	
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];

}

function openGameFullscreen(game) {
	
	var url = '/launchFlashGame.aqp?fullscreen=true&game=' + game;
	var windowFeatures="toolbar=0,scrollbars=0,menubar=0,location=0,resizable=0,directories=0,status=0,fullscreen=yes,width=" + (screen.width) + ",height=" + (screen.height-20) + ",left=0,top=0";
	var newWindow = open(url, 'FullScreenFlash', windowFeatures);
	window.close();
	
}

function openNetEntGameFullscreen(game) {
	
	var url = '/netentLaunchFlashGame.aqp?fullscreen=true&game=' + game;
	var windowFeatures="toolbar=0,scrollbars=0,menubar=0,location=0,resizable=0,directories=0,status=0,fullscreen=yes,width=" + (screen.width) + ",height=" + (screen.height-20) + ",left=0,top=0";
	var newWindow = open(url, 'FullScreenFlash', windowFeatures);
	window.close();
	
}

function createCookie(name,value,days) {
	
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";

	document.cookie = name+"="+value+expires+"; path=/";

}

function readCookie(name) {
	
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');

	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}

	return null;

}

function eraseCookie(name) {

	createCookie(name,"",-1);

}

function processAll(frm,cashableBalance){
	
	var allchecked = frm.allChecked;
	var f = frm.amount;
	
	if (allchecked.checked){
		if (cashableBalance.indexOf("kr") != -1) {
			f.value=cashableBalance.substring(2);
		}
		else {
			f.value=cashableBalance.substring(1);
		}
	}
	else{
		f.value="";
	}

}

function validateWebSigninForm(frm) {

	if (frm.username.value.length == 0) {
		alert("Please enter your user name");
		frm.username.focus();
		return false;
	}

	if (frm.password.value.length == 0) {
		alert("Please enter your password");
		frm.password.focus();
		return false;
	}

	return true;

}

function validateMobileSigninForm(frm) {

	if (frm.phonenumber.value.length == 0) {
		alert("Please enter your phone number");
		frm.phonenumber.focus();
		return false;
	}

	if (frm.pincode.value.length == 0) {
		alert("Please enter your pincode");
		frm.pincode.focus();
		return false;
	}

	return true;

}

function rules(url) {

	var features="directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=440,height=420";
	var remote = open(url, "rules", features);

}

function showgame(){
	
	if (document.all || document.getElementById) {
		if (document.getElementById("loading")) {
			document.getElementById("loading").style.display="none";
			document.getElementById("gameapplet").style.display="inline";
		}
	}
	else {
		if (document.loading) {
			document.loading.display="none";
			document.gameapplet.display="inline";
		}
	}
	
}	

var tickertapeform;
tt_speed=350;
tt_len=35;
tt_space="                                                                                                    ";
tt_tid = 0;
tt_message=".";
tt_c= -tt_len;

function move() {
	
	cend=Math.min(tt_c+tt_len,tt_message.length);
	
	if (tt_c <0)
		cstart=0;
	else
		cstart=tt_c;
	
	if (tt_c < 0)
		tt_f.scroll.value=tt_space.substring(0,-tt_c) + tt_message.substring(cstart,cend);
	else
		tt_f.scroll.value=tt_message.substring(cstart,cend);

		tt_c = tt_c +1;
	if (tt_c == tt_message.length ) tt_c = -tt_len;
	tt_tid=window.setTimeout("move()",tt_speed);

}

function tt_start(x) {

	tt_f=x;
	
	tt_tid=window.setTimeout("move()",tt_speed);

}

function tt_cleartid() {

	window.clearTimeout(tt_tid);

}

function ticker(m,l,s){

	tt_message=m;
	tt_len=l;
	tt_speed=s;
	document.write('<FORM name=tickertapeform><input name=scroll size=');
	document.write(tt_len);
	document.write(' value=""></FORM>');
	tt_start(document.tickertapeform);

}

function openGameWindow(width,height,title){

	height = height + 80;

	var features="directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=" + width + ",height=" + height;

	open("/aqfragments/aq_netent_game.jsp",title,features);

}

function MM_preloadImages() { // v3.0

	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImgRestore() { // v3.0

	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_findObj(n, d) { // v4.01

	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;

}

function MM_swapImage() { // v3.0

	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

function MM_openBrWindow(theURL,winName,features) { // v2.0

	window.open(theURL,winName,features);

}

function MM_showHideLayers() { // v6.0

	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }

}


function launchFullScreenFlash(game) {

	var features="toolbar=0,scrollbars=0,menubar=0,location=0,resizable=0,directories=0,status=1,fullscreen=no,width=" + (screen.width - 10) + ",height=" + (screen.height - 20) + ",left=0,top=0";

	open("/netentLaunchFlashGame.aqp?fullscreen=true&game="+game, "FullScreen", features);

}

// Define Strengths and Weaknesses
function buildWeak() {

	var jQueryweak='';
	
	jQueryweak=jQueryweak+'a';
	jQueryweak=jQueryweak+'b';
	jQueryweak=jQueryweak+'c';
	jQueryweak=jQueryweak+'d';
	jQueryweak=jQueryweak+'e';
	jQueryweak=jQueryweak+'f';
	jQueryweak=jQueryweak+'g';
	jQueryweak=jQueryweak+'h';
	jQueryweak=jQueryweak+'i';
	jQueryweak=jQueryweak+'j';
	jQueryweak=jQueryweak+'k';
	jQueryweak=jQueryweak+'l';
	jQueryweak=jQueryweak+'m';
	jQueryweak=jQueryweak+'n';
	jQueryweak=jQueryweak+'o';
	jQueryweak=jQueryweak+'p';
	jQueryweak=jQueryweak+'q';
	jQueryweak=jQueryweak+'r';
	jQueryweak=jQueryweak+'s';
	jQueryweak=jQueryweak+'t';
	jQueryweak=jQueryweak+'u';
	jQueryweak=jQueryweak+'v';
	jQueryweak=jQueryweak+'w';
	jQueryweak=jQueryweak+'x';
	jQueryweak=jQueryweak+'y';
	jQueryweak=jQueryweak+'z';

	return jQueryweak;

}

function buildMedium() {

	var jQuerymedium='';
	
	jQuerymedium=jQuerymedium+'0';
	jQuerymedium=jQuerymedium+'1';
	jQuerymedium=jQuerymedium+'2';
	jQuerymedium=jQuerymedium+'3';
	jQuerymedium=jQuerymedium+'4';
	jQuerymedium=jQuerymedium+'5';
	jQuerymedium=jQuerymedium+'6';
	jQuerymedium=jQuerymedium+'7';
	jQuerymedium=jQuerymedium+'8';
	jQuerymedium=jQuerymedium+'9';
	jQuerymedium=jQuerymedium+'A';
	jQuerymedium=jQuerymedium+'B';
	jQuerymedium=jQuerymedium+'C';
	jQuerymedium=jQuerymedium+'D';
	jQuerymedium=jQuerymedium+'E';
	jQuerymedium=jQuerymedium+'F';
	jQuerymedium=jQuerymedium+'G';
	jQuerymedium=jQuerymedium+'H';
	jQuerymedium=jQuerymedium+'I';
	jQuerymedium=jQuerymedium+'J';
	jQuerymedium=jQuerymedium+'K';
	jQuerymedium=jQuerymedium+'L';
	jQuerymedium=jQuerymedium+'M';
	jQuerymedium=jQuerymedium+'N';
	jQuerymedium=jQuerymedium+'O';
	jQuerymedium=jQuerymedium+'P';
	jQuerymedium=jQuerymedium+'Q';
	jQuerymedium=jQuerymedium+'R';
	jQuerymedium=jQuerymedium+'S';
	jQuerymedium=jQuerymedium+'T';
	jQuerymedium=jQuerymedium+'U';
	jQuerymedium=jQuerymedium+'V';
	jQuerymedium=jQuerymedium+'W';
	jQuerymedium=jQuerymedium+'X';
	jQuerymedium=jQuerymedium+'Y';
	jQuerymedium=jQuerymedium+'Z';
	
	return jQuerymedium;

}

function buildStrong() {
	
	var jQuerystrong='';
	
	jQuerystrong=jQuerystrong+'!';
	jQuerystrong=jQuerystrong+'!';
	jQuerystrong=jQuerystrong+'#';
	jQuerystrong=jQuerystrong+'jQuery';
	jQuerystrong=jQuerystrong+'%';
	jQuerystrong=jQuerystrong+'&';
	jQuerystrong=jQuerystrong+',';
	jQuerystrong=jQuerystrong+'.';
	jQuerystrong=jQuerystrong+':';
	jQuerystrong=jQuerystrong+'-';
	jQuerystrong=jQuerystrong+'­';
	jQuerystrong=jQuerystrong+'­';
	jQuerystrong=jQuerystrong+'–';
	jQuerystrong=jQuerystrong+'—';
	jQuerystrong=jQuerystrong+';';
	jQuerystrong=jQuerystrong+'?';
	jQuerystrong=jQuerystrong+'@';
	jQuerystrong=jQuerystrong+'[';
	jQuerystrong=jQuerystrong+']';
	jQuerystrong=jQuerystrong+'^';
	jQuerystrong=jQuerystrong+'ˆ';
	jQuerystrong=jQuerystrong+'_';
	jQuerystrong=jQuerystrong+'{';
	jQuerystrong=jQuerystrong+'|';
	jQuerystrong=jQuerystrong+'}';
	jQuerystrong=jQuerystrong+'~';
	jQuerystrong=jQuerystrong+'¡';
	jQuerystrong=jQuerystrong+'¡';
	jQuerystrong=jQuerystrong+'¦';
	jQuerystrong=jQuerystrong+'¦';
	jQuerystrong=jQuerystrong+'¨';
	jQuerystrong=jQuerystrong+'¨';
	jQuerystrong=jQuerystrong+'¯';
	jQuerystrong=jQuerystrong+'¯';
	jQuerystrong=jQuerystrong+'¸';
	jQuerystrong=jQuerystrong+'¸';
	jQuerystrong=jQuerystrong+'¿';
	jQuerystrong=jQuerystrong+'¿';
	jQuerystrong=jQuerystrong+'˜';
	jQuerystrong=jQuerystrong+'‚';
	jQuerystrong=jQuerystrong+'„';
	jQuerystrong=jQuerystrong+'‹';
	jQuerystrong=jQuerystrong+'›';
	jQuerystrong=jQuerystrong+'›';
	jQuerystrong=jQuerystrong+'+';
	jQuerystrong=jQuerystrong+'<';
	jQuerystrong=jQuerystrong+'=';
	jQuerystrong=jQuerystrong+'>';
	jQuerystrong=jQuerystrong+'±';
	jQuerystrong=jQuerystrong+'±';
	jQuerystrong=jQuerystrong+'«';
	jQuerystrong=jQuerystrong+'«';
	jQuerystrong=jQuerystrong+'»';
	jQuerystrong=jQuerystrong+'»';
	jQuerystrong=jQuerystrong+'×';
	jQuerystrong=jQuerystrong+'×';
	jQuerystrong=jQuerystrong+'÷';
	jQuerystrong=jQuerystrong+'÷';
	jQuerystrong=jQuerystrong+'¢';
	jQuerystrong=jQuerystrong+'¢';
	jQuerystrong=jQuerystrong+'£';
	jQuerystrong=jQuerystrong+'£';
	jQuerystrong=jQuerystrong+'¤';
	jQuerystrong=jQuerystrong+'¤';
	jQuerystrong=jQuerystrong+'¥';
	jQuerystrong=jQuerystrong+'¥';
	jQuerystrong=jQuerystrong+'§';
	jQuerystrong=jQuerystrong+'§';
	jQuerystrong=jQuerystrong+'©';
	jQuerystrong=jQuerystrong+'©';
	jQuerystrong=jQuerystrong+'¬';
	jQuerystrong=jQuerystrong+'¬';
	jQuerystrong=jQuerystrong+'®';
	jQuerystrong=jQuerystrong+'®';
	jQuerystrong=jQuerystrong+'°';
	jQuerystrong=jQuerystrong+'°';
	jQuerystrong=jQuerystrong+'µ';
	jQuerystrong=jQuerystrong+'µ';
	jQuerystrong=jQuerystrong+'†';
	jQuerystrong=jQuerystrong+'‡';
	jQuerystrong=jQuerystrong+'•';
	jQuerystrong=jQuerystrong+'…';
	jQuerystrong=jQuerystrong+'‰';
	jQuerystrong=jQuerystrong+'€';
	jQuerystrong=jQuerystrong+'¼';
	jQuerystrong=jQuerystrong+'¼';
	jQuerystrong=jQuerystrong+'½';
	jQuerystrong=jQuerystrong+'½';
	jQuerystrong=jQuerystrong+'¾';
	jQuerystrong=jQuerystrong+'¾';
	jQuerystrong=jQuerystrong+'¹';
	jQuerystrong=jQuerystrong+'¹';
	jQuerystrong=jQuerystrong+'²';
	jQuerystrong=jQuerystrong+'²';
	jQuerystrong=jQuerystrong+'³';
	jQuerystrong=jQuerystrong+'³';
	jQuerystrong=jQuerystrong+'ª';
	jQuerystrong=jQuerystrong+'ª';
	jQuerystrong=jQuerystrong+'Á';
	jQuerystrong=jQuerystrong+'á';
	jQuerystrong=jQuerystrong+'À';
	jQuerystrong=jQuerystrong+'à';
	jQuerystrong=jQuerystrong+'Â';
	jQuerystrong=jQuerystrong+'â';
	jQuerystrong=jQuerystrong+'Ä';
	jQuerystrong=jQuerystrong+'ä';
	jQuerystrong=jQuerystrong+'Ã';
	jQuerystrong=jQuerystrong+'ã';
	jQuerystrong=jQuerystrong+'Å';
	jQuerystrong=jQuerystrong+'å';
	jQuerystrong=jQuerystrong+'Æ';
	jQuerystrong=jQuerystrong+'æ';
	jQuerystrong=jQuerystrong+'Ç';
	jQuerystrong=jQuerystrong+'ç';
	jQuerystrong=jQuerystrong+'Ð';
	jQuerystrong=jQuerystrong+'ð';
	jQuerystrong=jQuerystrong+'É';
	jQuerystrong=jQuerystrong+'é';
	jQuerystrong=jQuerystrong+'È';
	jQuerystrong=jQuerystrong+'è';
	jQuerystrong=jQuerystrong+'Ê';
	jQuerystrong=jQuerystrong+'ê';
	jQuerystrong=jQuerystrong+'Ë';
	jQuerystrong=jQuerystrong+'ë';
	jQuerystrong=jQuerystrong+'ƒ';
	jQuerystrong=jQuerystrong+'Í';
	jQuerystrong=jQuerystrong+'í';
	jQuerystrong=jQuerystrong+'Ì';
	jQuerystrong=jQuerystrong+'ì';
	jQuerystrong=jQuerystrong+'Î';
	jQuerystrong=jQuerystrong+'î';
	jQuerystrong=jQuerystrong+'Ï';
	jQuerystrong=jQuerystrong+'ï';
	jQuerystrong=jQuerystrong+'Ñ';
	jQuerystrong=jQuerystrong+'ñ';
	jQuerystrong=jQuerystrong+'º';
	jQuerystrong=jQuerystrong+'º';
	jQuerystrong=jQuerystrong+'Ó';
	jQuerystrong=jQuerystrong+'ó';
	jQuerystrong=jQuerystrong+'Ò';
	jQuerystrong=jQuerystrong+'ò';
	jQuerystrong=jQuerystrong+'Ô';
	jQuerystrong=jQuerystrong+'ô';
	jQuerystrong=jQuerystrong+'Ö';
	jQuerystrong=jQuerystrong+'ö';
	jQuerystrong=jQuerystrong+'Õ';
	jQuerystrong=jQuerystrong+'õ';
	jQuerystrong=jQuerystrong+'Ø';
	jQuerystrong=jQuerystrong+'ø';
	jQuerystrong=jQuerystrong+'Œ';
	jQuerystrong=jQuerystrong+'œ';
	jQuerystrong=jQuerystrong+'Š';
	jQuerystrong=jQuerystrong+'š';
	jQuerystrong=jQuerystrong+'ß';
	jQuerystrong=jQuerystrong+'Þ';
	jQuerystrong=jQuerystrong+'þ';
	jQuerystrong=jQuerystrong+'™';
	jQuerystrong=jQuerystrong+'Ú';
	jQuerystrong=jQuerystrong+'ú';
	jQuerystrong=jQuerystrong+'Ù';
	jQuerystrong=jQuerystrong+'ù';
	jQuerystrong=jQuerystrong+'Û';
	jQuerystrong=jQuerystrong+'û';
	jQuerystrong=jQuerystrong+'Ü';
	jQuerystrong=jQuerystrong+'ü';
	jQuerystrong=jQuerystrong+'Ý';
	jQuerystrong=jQuerystrong+'ý';
	jQuerystrong=jQuerystrong+'Ÿ';
	jQuerystrong=jQuerystrong+'ÿ';
	jQuerystrong=jQuerystrong+'Ž';
	jQuerystrong=jQuerystrong+'ž';
	return jQuerystrong;

}

function buildIllegal() {
	
	var jQueryillegal='';
	
	jQueryillegal=jQueryillegal+'(';
	jQueryillegal=jQueryillegal+')';
	jQueryillegal=jQueryillegal+'*';
	jQueryillegal=jQueryillegal+"'";
	jQueryillegal=jQueryillegal+'`';
	jQueryillegal=jQueryillegal+'´';
	jQueryillegal=jQueryillegal+'‘';
	jQueryillegal=jQueryillegal+'’';
	jQueryillegal=jQueryillegal+'“';
	jQueryillegal=jQueryillegal+'"';
	jQueryillegal=jQueryillegal+'”';
	jQueryillegal=jQueryillegal+'¶';
	jQueryillegal=jQueryillegal+'·';
	jQueryillegal=jQueryillegal+'/';
	jQueryillegal=jQueryillegal+'\\';

	return jQueryillegal;

}



function isWhat(jQuerych,jQuerywhat) {
// Searches for something, if it has it, it returns true...

var jQueryisat=-1;

if (jQuerywhat=="illegal") {
// Find if this is a strong char
var jQueryillegal=buildIllegal();
jQueryisat=jQueryillegal.indexOf(jQuerych);
}

if (jQuerywhat=="strong") {
// Find if this is a strong char
var jQuerystrong=buildStrong();
jQueryisat=jQuerystrong.indexOf(jQuerych);
}

if (jQuerywhat=="medium") {
// Find if this is a strong char
var jQuerymedium=buildMedium();
jQueryisat=jQuerymedium.indexOf(jQuerych);
}

if (jQuerywhat=="weak") {
// Find if this is a strong char
var jQueryweak=buildWeak();
jQueryisat=jQueryweak.indexOf(jQuerych);
}

if (jQueryisat>-1) {
return true;
}
if (jQueryisat==-1) {
return false;
}

}



// ######################################################################
// END SYSTEM SETUP
// ######################################################################




// ///////////////////////////////////////////////////////////////////////
// MAIN FUNCTION!!!! (You shouldn't modify the above part...
// MODIFYING THIS SCRIPT, AND IT STOPS WORKING, MEANS FIX YOUR ERRORS....
// ///////////////////////////////////////////////////////////////////////


function updateStrength(frm) {
	// Different factors will contribute to password strength
	// A weak password contains only characters or only numbers
	// A strong password contains numbers, characters, upper case + lower case
	// A medium password contains characters, lower case + upper case
	// A 3/4 password contains characters, numbers, upper + lower
	
	var register = frm;
	
	jQueryscore='weak';
	
	// Pull back password field
	jQuerypw=register.password.value;
	
	// Takes current PW, and loads it into the slicer
	var jQuerych='';
	var jQueryisweak='';
	var jQueryisstrong='';
	var jQueryismedium='';
	var jQueryisillegal='';
	
	var jQueryhighest='';
	
	// //////////////////////////////////////////////////////////////
	// Before dissecting the password, see if it is a number only!
	// Numbers only are the WEAKEST... If you had 5000 as your password,
	// It could be hacked in 5000 tries! Bad Idea!
	// //////////////////////////////////////////////////////////////
	var jQuerydivnum=0;
	
	jQuerydivnum=jQuerypw * 1;
	
	if (jQuerydivnum==jQuerypw) {
	// This is a number, because it multiplied times 1 and returned itself.
	// I find it's the easiest way to check numbers
	jQueryhighest='weak';
	jQueryscore='weak';
	} else {
		// document.print('<hr><br>slicing: ' + jQuerypw + ' with ' + jQuerypw.length + '
		// slices.<br><br>');
		for (jQueryx=0; jQueryx < jQuerypw.length; jQueryx++) {
			
			// This will keep cutting the pw, checking for weak/strong.
			// For the password to be strong, it must be 4 characters long, and be isstrong
			// For a password to be medium, it must be 4 characters long, and be ismedium
			// For a password to be weak, it must be 4 characters long, and be isweak
			// Passwords that are numbers only or less than 4 characters are weak.
			
			jQuerych=jQuerypw.charAt(jQueryx);
			jQueryisillegal=isWhat(jQuerych,'illegal');
			jQueryisstrong=isWhat(jQuerych,'strong');
			jQueryismedium=isWhat(jQuerych,'medium');
			jQueryisweak=isWhat(jQuerych,'weak');
			
			// Based on this character, we can determine the nature of the strength
			if (jQueryisillegal==true) {
				// contains an illegal character, we don't want these in our systems!
				// prompt the user, letting them know they entered an illegal character
				jQueryisresult='illegal';
				jQueryhighest='illegal';
			}
			
			if (jQueryisstrong==true) {
				// contains a weak character
				jQueryisresult='strong';
				
				if (jQueryhighest=='illegal') {
				}
				else {
					jQueryhighest='strong';
				}
			}
			if (jQueryismedium==true) {
				// contains a weak character
				jQueryisresult='medium';
	
				if (jQueryhighest=='illegal') {
				} 
				else {
					if (jQueryhighest=='strong') {
					} 
					else {
						jQueryhighest='medium';
					}
				}
			}
			
			if (jQueryisweak==true) {
			// contains a weak character
			jQueryisresult='weak';
				if (jQueryhighest=='illegal') {
				} else {
					if (jQueryhighest=='strong') {
					} else {
						if (jQueryhighest=='medium') {
						} else {
							jQueryhighest='weak';
						}
					}
				}
			} 
		} // for x
	} // check for div * 1
		
		
	// From here we should measure the strength on a scale of some sorts...
	// Preferably images...
	
	if (jQueryhighest=='illegal') {
		alert('The character you entered cannot be part of your password. Please enter a new password, without this character: '+jQuerych+'.');
		jQueryscore='illegal';
		register.password.value=''; // This will reset the field, because illegal
									// characters aren't wanted.
		document.images["strength"].src="images/aq/aq_1.png";
	}
	else {
		jQueryscore=jQueryhighest;
		if (jQueryhighest=="illegal") {
			document.images["strength"].src="images/aq/aq_1.png";
		}
		if (jQueryhighest=="strong") {
			document.images["strength"].src="images/aq/aq_4.png";
		}
		if (jQueryhighest=="medium") {
			document.images["strength"].src="images/aq/aq_3.png";
		}
		if (jQueryhighest=="weak") {
			document.images["strength"].src="images/aq/aq_2.png";
		}
	}
	
	
	// If it contains 4 or more characters, allow over weak
	jQuerylen=jQuerypw.length;
	
	if (jQuerylen<6) {
		jQueryscore='weak';
		document.images["strength"].src="images/aq/aq_1.png";
	}
	
	if (jQuerylen>17) {
		if (jQueryscore=='medium') {
			// Well... it's medium, but it has 17 characters.. Seems pretty tough to me?
			document.images["strength"].src="images/aq/aq_4.png";
			jQueryscore='strong';
		}
	}
	// You should do more stuff here... Like what I did:
	if (jQuerylen>10) {
		if (jQueryscore=='weak') {
			// Well... it's weak, but it has 10 characters.. Seems pretty tough to me?
			document.images["strength"].src="images/aq/aq_3.png";
			jQueryscore='medium';
		}
	}

}

/*******************************************************************************
 * Moveable Div
 ******************************************************************************/
function Browser() {

	var ua, s, i;
	
	this.isIE    = false;
	this.isNS    = false;
	this.version = null;
	
	ua = navigator.userAgent;
	
	s = "MSIE";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isIE = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	
	s = "Netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	
	// Treat any other "Gecko" browser as NS 6.1.
	
	s = "Gecko";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = 6.1;
		return;
	}
}

var browser = new Browser();

// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 9999;

function resetDiv(id,marker){

	x = document.getElementById(marker).style.left;
	y = document.getElementById(marker).style.left;
	document.getElementById(id).style.left = x;
	document.getElementById(id).style.top = y;
	
	createCookie('div' + id + 'PosX',x,99);
	createCookie('div' + id + 'PosY',y,99);

}

function dragStart(event, id) {
	
	var el;
	var x, y;
	
	// If an element id was given, find it. Otherwise use the element being
	// clicked on.
	
	if (id)
		dragObj.elNode = document.getElementById(id);
	else {
	if (browser.isIE)
		dragObj.elNode = window.event.srcElement;
	if (browser.isNS)
		dragObj.elNode = event.target;
	
	// If this is a text node, use its parent element.
	
	if (dragObj.elNode.nodeType == 3)
		dragObj.elNode = dragObj.elNode.parentNode;
	}
	
	// alert('o:' + dragObj.elNode);
	// Get cursor position with respect to the page.
	dragObj.elNode.style.cursor='move';
	
	if (browser.isIE) {
		x = window.event.clientX + document.documentElement.scrollLeft
		+ document.body.scrollLeft;
		y = window.event.clientY + document.documentElement.scrollTop
		+ document.body.scrollTop;
	}
	
	if (browser.isNS) {
		x = event.clientX + window.scrollX;
		y = event.clientY + window.scrollY;
	}
	
	// Save starting positions of cursor and element.
	
	dragObj.cursorStartX = x;
	dragObj.cursorStartY = y;
	dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
	dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);
	
	if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
	if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;
	
	// Update element's z-index.

	dragObj.elNode.style.zIndex = ++dragObj.zIndex;
	
	// Capture mousemove and mouseup events on the page.

	if (browser.isIE) {
		document.attachEvent("onmousemove", dragGo);
		document.attachEvent("onmouseup",   dragStop);
		window.event.cancelBubble = true;
		window.event.returnValue = false;
	}
	
	if (browser.isNS) {
		document.addEventListener("mousemove", dragGo,   true);
		document.addEventListener("mouseup",   dragStop, true);
		event.preventDefault();
	}

}

function dragGo(event) {
	
	var x, y;
	
	// Get cursor position with respect to the page.
	
	if (browser.isIE) {
		x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	}
	
	if (browser.isNS) {
		x = event.clientX + window.scrollX;
		y = event.clientY + window.scrollY;
	}
	
	// Move drag element by the same amount the cursor has moved.
	
	dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
	dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";
	
	if (browser.isIE) {
		window.event.cancelBubble = true;
		window.event.returnValue = false;
	}

	if (browser.isNS)
		event.preventDefault();

}

function dragStop(event) {

	// Stop capturing mousemove and mouseup events.
	
	if (browser.isIE) {
		document.detachEvent("onmousemove", dragGo);
		document.detachEvent("onmouseup",   dragStop);
	}

	if (browser.isNS) {
		document.removeEventListener("mousemove", dragGo,   true);
		document.removeEventListener("mouseup",   dragStop, true);
	}
	
	createCookie('div' + dragObj.elNode.id + 'PosX',dragObj.elNode.style.left,99);
	createCookie('div' + dragObj.elNode.id + 'PosY',dragObj.elNode.style.top,99);

	dragObj.elNode.style.cursor='auto';

}


function popUP(mypage, myname, w, h, scroll, titlebar){

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
	
}

function postIt(){
	
	var upload = document.getElementById("upload");
	if(upload)
	{
	popUP("/en/pages/upload/progress.jsp","hello",400,200,false,false);
	}
	
	return true;
	
}

function popupHelp(url) {
	
	var newwindow=window.open('/en/pages/help/' + url,'Help','width=600,height=400,resizable=yes'); 

	return false;
	
}

function popUpMenu(url,name) {
	
	newWindow = window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=no,resizable=no,width=640,height=480');
	
}

function validateSigninForm(frm) {
	
	if (frm.username.value.length == 0) {
		alert("Please enter your email address");
		frm.username.focus();
		return false;
	}
	
	if (frm.password.value.length == 0) {
		alert("Please enter your password");
		frm.username.focus();
		return false;
	}
	
	if ((frm.username.value.indexOf("@") == -1) || (frm.username.value.indexOf(".") == -1)) {
		alert("Please enter a valid e-mail address.");
		frm.username.select();
		frm.username.focus();
		return false;
	}
	
	return true;
	
}

function popUp(URL){;

	sizedPopUpWithTitle(URL,"Popup",800,550);
	
}

function sizedPopUp(URL,width,height){

	sizedPopUpWithTitle(URL,"Popup",width,height);
	
}	

function sizedPopUpWithTitle(URL,title,width,height){

	var newWindowWidth = width + pageIncreaseWidth;
	var newWindowHeight = height + pageIncreaseHeight;
	
	URL = replaceAll(URL,"!","&");
	if (URL.indexOf("?") != -1){
		URL = URL + "&";
	}
	else{
		URL = URL + "?";
	}
	URL = URL + "width=" + width + "&height=" + height;
	
	day = new Date();
	id = day.getTime();
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	var props = "toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width=" + newWindowWidth + "px,height=" + newWindowHeight + "px,left = " + winl + "px,top = " + wint + "px";

	eval("page" + id + " = window.open(URL, '" + id + "', '" + props + "');");

}

function replaceAll(txt, replace, with_this) {
	  return txt.replace(new RegExp(replace, 'g'),with_this);
}

function dispTTip(formID) {
    jQuery('input,textarea','#'+formID).tooltip({
        delay:200,
        top:-5
    });
}

/***********************************************
* Balloon Tool Tip
***********************************************/
var offsetxpoint=-60; //Customize x offset of tooltip
var offsetypoint=20; //Customize y offset of tooltip
var ie=document.all;
var ns6=document.getElementById && !document.all;
var enableBalloon=false;
if (ie||ns6)
var balloonObj=document.all? document.all["balloon"] : document.getElementById? document.getElementById("balloon") : ""

function ietruebody(){
	
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

}

function showBalloon(thetext, thecolor, thewidth){
	
	if (balloonObj == null){
		createBalloonDiv("balloon"); 
		balloonObj=document.all? document.all["balloon"] : document.getElementById? document.getElementById("balloon") : ""
	}
	
	if (ns6||ie){
		if (typeof thewidth!="undefined") balloonObj.style.width=thewidth+"px";
		if (typeof thecolor!="undefined" && thecolor!="") balloonObj.style.backgroundColor=thecolor;
		balloonObj.innerHTML=thetext;
		enableBalloon=true;
		return false;
	}
}

function moveBalloon(e){

	if (enableBalloon){
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
		
		//Find out how close the mouse is to the corner of the window
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
	
		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;
	
		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge<balloonObj.offsetWidth)
		//move the horizontal position of the menu to the left by it's width
			balloonObj.style.left=ie? ietruebody().scrollLeft+event.clientX-balloonObj.offsetWidth+"px" : window.pageXOffset+e.clientX-balloonObj.offsetWidth+"px";
		else 
			if (curX<leftedge)
				balloonObj.style.left="5px";
			else
		//position the horizontal position of the menu where the mouse is positioned
				balloonObj.style.left=curX+offsetxpoint+"px";
	
		//same concept with the vertical position
		if (bottomedge<balloonObj.offsetHeight)
			balloonObj.style.top=ie? ietruebody().scrollTop+event.clientY-balloonObj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-balloonObj.offsetHeight-offsetypoint+"px";
		else
			balloonObj.style.top=curY+offsetypoint+"px";
	
		balloonObj.style.visibility="visible";
		balloonObj.style.zIndex=99;
	}
}

function hideBalloon(){

	if (ns6||ie){
			enableBalloon=false;
			balloonObj.style.visibility="hidden";
			balloonObj.style.left="-1000px";
			balloonObj.style.backgroundColor='';
			balloonObj.style.width='';
	}
	
}

document.onmousemove=moveBalloon;

function createBalloonDiv(id, html, width, height, left, top) {
	   var newdiv = document.createElement('div');
	   newdiv.setAttribute('id', id);
	   
	   if (width) {
	       newdiv.style.width = 300;
	   }
	   
	   if (height) {
	       newdiv.style.height = 300;
	   }
	   
	   if ((left || top) || (left && top)) {
	       newdiv.style.position = "absolute";
	       
	       if (left) {
	           newdiv.style.left = left;
	       }
	       
	       if (top) {
	           newdiv.style.top = top;
	       }
	   }
	   
	   if (html) {
	       newdiv.innerHTML = html;
	   } else {
	       newdiv.innerHTML = "nothing";
	   }
	   
	   document.body.appendChild(newdiv);
	}



function kioskPinCodePress(key){

	var error = document.getElementById("kioskError");
	
	if (key == 'E'){
		if (document.getElementById("kioskField").value.length < 4) {
			error.innerHTML = "Please enter a valid code";
		}	
		else{
			$('#loadingDiv').toggle();
			document.getElementById("kioskForm").submit();
		}
	}
	else if (key == 'B'){
		error.innerHTML = "<br/>";
		var value = document.getElementById("kioskField").value;
		if (value.length > 0){
			document.getElementById("kioskField").value = value.substr(0,value.length-1);
		}	 
	}
	else{
		error.innerHTML = "<br/>";
		if (document.getElementById("kioskField").value.length < document.getElementById("kioskField").maxLength) {
			document.getElementById("kioskField").value = document.getElementById("kioskField").value + key;
		}
	}
	
}




/*
Cookie Scripts
*/

// To use, simple do: Get_Cookie('cookie_name'); 
// replace cookie_name with the real cookie name, '' are required
function getCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	var i = '';
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) 
	{
		return null;
	}
}

/*
only the first 2 parameters are required, the cookie name, the cookie
value. Cookie time is in milliseconds, so the below expires will make the 
number you pass in the Set_Cookie function call the number of days the cookie
lasts, if you want it to be hours or minutes, just get rid of 24 and 60.

Generally you don't need to worry about domain, path or secure for most applications
so unless you need that, leave those parameters blank in the function call.
*/
function setCookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 
		* 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function deleteCookie( name, path, domain ) {
	if ( getCookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

setCookie( 'test', 'tahdah', '', '/', '', '' );

//if Get_Cookie succeeds, cookies are enabled, since
//the cookie was successfully created.
if ( getCookie( 'test' ) )
{
	cookie_set = true;
	deleteCookie('test', '/', '');
}
else
{
	alert( 'cookies are not currently enabled.' );
	cookie_set = false;
}

/*
var xxjs = {
	    accordFunc : function(elm){
		    jQuery(elm).accordion({
		        header:     "dt",
		        active:     false,
		        alwaysOpen: false,
		        selectedClass: 'current',
		        autoheight: false
		    });
		},

		dispTTip : function(formID) {
			jQuery('input,textarea','#'+formID).tooltip({
		        delay:200,
		        top:-5
		    });
		},

}
*/

(function(jQuery){
	jQuery.fn.extend({ 
 		defaultbox : function(options) {
			//var defaults = {};
				
			//var options =  $.extend(defaults, options);

    		return this.each(function() {
				//var o = options;

    			jQuery(this).blur(function(){
					var element = jQuery(this);
					if(element.attr('value') == '' || element.attr('value') == null)
					{
						var dom = (element.get())[0];
						element.attr('value', dom.defaultValue);
					}
				}).focus(function(){
					var element = jQuery(this);
					var dom = (element.get())[0];
					
					if(element.attr('value') == dom.defaultValue)
					{
						element.attr('value', "");
					}
				});		
    		});
		}
	});
})(jQuery);

function XmlHttp() {
	this.CreateXmlHttpObject = CreateXmlHttpObject;
	this.GetUrlContent = GetUrlContent;
	this.GetResponseText = GetResponseText;
	this.GetReadyState = GetReadyState;
	this.HttpMethod = 'GET'; // default
	this.objXmlHttp = this.CreateXmlHttpObject();
}

// Initialize XMLHttpObject
function CreateXmlHttpObject() {
	var xmlhttp;
	      try {
	          // Mozilla / Safari / IE7
	          xmlhttp = new XMLHttpRequest();
	      }
	      catch (e) {
	           // IE
	           var XMLHTTP_IDS = new Array('MSXML2.XMLHTTP.5.0',
	                                     'MSXML2.XMLHTTP.4.0',
	                                     'MSXML2.XMLHTTP.3.0',
	                                     'MSXML2.XMLHTTP',
	                                     'Microsoft.XMLHTTP' );
	          var success = false;
	      
	          for (var i=0;i < XMLHTTP_IDS.length && !success; i++) {
	              try {
	                   xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);
	                      success = true;
	                } catch (e) {}
	          }
	          
	          if (!success) {
	              throw new Error('Unable to create XMLHttpRequest.');
	          }
	          
	     }
	     
	     return xmlhttp;

}


var objXMLHttp = new XmlHttp();

function GetReadyState() {
	return this.objXmlHttp.readyState;
}

function GetResponseText() {
	return this.objXmlHttp.responseText;
}

// Function performs Get request to absolute url(strUrl)
// using XmlHttp object (asynchroni)
// Response returned into objResult element using innerHTML.
// When state of XmlHttp object is changed - objOnReadyStateChangeFunction
// called
function GetUrlContent(strUrl, objOnReadyStateChangeFunction) {
	this.objXmlHttp.open(this.HttpMethod, strUrl, true);
	this.objXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=UTF-8');
	if (objOnReadyStateChangeFunction) {
		this.objXmlHttp.onreadystatechange = function() {
			objOnReadyStateChangeFunction();
		}
	}
	this.objXmlHttp.send(null);
}

// This function is called when we get the data back from the server.
function getRefreshResponse() {
	if (objXMLHttp.GetReadyState() == 4) {
		var bal = objXMLHttp.GetResponseText();
		jQuery("#ajaxRefresh").html(bal);
	}
}

function refresh(url,div) {
	
	var bal = getUrlContentSync(url);
	jQuery("#" + div).html(bal);
	
	setTimeout("refresh('" + url + "','" + div + "')",10000)
}

function getUrlContentSync(url) {
	
    AJAX=CreateXmlHttpObject();              

    if (AJAX) {
	    AJAX.open("GET", url, false);                             
	     AJAX.send(null);
	     return AJAX.responseText;                                         
	}
    else {
	     return false;
	 }                                             

}

jQuery(document).ready(function(){ // Disable enter key
    jQuery('select,textarea').keypress(function(e){
        return ((e.which==13)?false:true);
    });
});

jQuery.validator.addMethod("passwd", function(value,element) {
        return this.optional(element) || /^[^\s+]+$/i.test(value);
    },
    "This field can not contain whitespaces!"
); 

jQuery.validator.addMethod("phoneNb", function(value,element) {
        var value = value.replace(/\s+/g, "");
        return this.optional(element) || /^\+?\d+$/i.test(value);
    },
    "Please specify a valid phone number"
);

jQuery.validator.addMethod("alphanum", function(value,element) {
        return this.optional(element) || /^\w+$/i.test(value);
    },
    "Letters, numbers or underscores only please!"
); 

/*
jQuery.validator.addMethod("alphanumspace", function(value,element) {
        return this.optional(element) || /(\w| )+/gi.test(value);
    },
    "Letters, numbers, spaces or underscores only please!"
); 
*/
jQuery.validator.addMethod("cashformat", function(value,element) {
        var value= value.replace(/\s+/g, "");
        return this.optional(element) || /^(\.?\d+)+$/.test(value);
    },
    "Please specify a valid cash amount"
);

jQuery.validator.addMethod("ccCvs", function(value,element) {
        var value = value.replace(/\s+/g, "");
        return this.optional(element) || /(\d|\*){3}/.test(value);
    },
    "Please specify a valid CVS number"
);

jQuery.validator.addMethod("advCCNB", function(value, element) {
        var value = value.replace(/\s+/g, "");
        return this.optional(element) || /(\d|\*){4}/.test(value);
    },
    "Please specify a valid credit card number"
);

jQuery.validator.addMethod("digitsAndStars", function(value, element) {
        var value = value.replace(/\s+/g, "");
        return this.optional(element) || /^(\d|\*)+$/.test(value);
    },
    "Digits and stars only, please!"
);

jQuery.validator.setDefaults({ 
    errorElement:"em",
    success:"st-ok",
    errorClass:"st-err",
    errorPlacement: function(error, element) { 
        error.appendTo(jQuery(element).next());
    },
    highlight: function(element, errorClass) {
        jQuery(element).addClass(errorClass);
    },
    unhighlight: function(element, errorClass) {
        jQuery(element).removeClass(errorClass);
    }
    //submitHandler: function(form) {
    //    // do other stuff for a valid form
    //    form.submit();
    //}
});

var aqfrm = {
/* ============== FORM VALIDATION ============== */
    checkForm : function(ftc){
        var frm = "#"+ftc;
        switch (ftc) {
// Registration form
            case "regdata":             
                var validator = jQuery(frm).validate({
                    rules:{
                        username:{required:true, alphanum:true, minlength:6, maxlength:20},
                        password:{required:true, passwd:true, minlength:6},
                        passwordConfirm:{required:true, passwd:true, minlength:6},
                        EMail:{required:true, email:true},
                        firstname:"required",
                        surname:"required",
                        address1:{required:true, minlength:6},
                        address2:"required",
                        address3:"required",
                        country:"required",
                        postcode:"required",
                        phonenumber:{required:true, phoneNb:true, minlength:8},
                        fixedphonenumber:{required:false, phoneNb:true, minlength:8},
                        dayOfBirth:{required:true, digits:true, min:1},
                        monthOfBirth:{required:true, digits:true, min:1},
                        yearOfBirth:{required:true, digits:true, min:1},
                        secretQuestion:"required",
                        secretAnswer:"required",
                        acceptTsAndCs:"required",
                        imageVerificationKey:{required:true, minlength:4, digits:true},
                        pin:{required:true, minlength:16, digits:true},
                        accountid:{required:true, minlength:12, digits:true},
                        secureid:{required:true, minlength:6, digits:true}
                    },
                    messages:{
                        username:{required:"Enter a username", minlength:"Enter at least 6 characters"},
                        password:{required:"Provide a password", minlength:"Enter at least 6 characters"},
                        passwordConfirm:{
                            required:"Repeat your password", 
                            minlength:"Enter at least 6 characters", 
                            equalTo:"Enter the same password as above" 
                        }, 
                        email:{
                            required:"Please enter a valid email address", 
                            minlength:"Please enter a valid email address" 
                        }, 
                        fixedphonenumber:{
                        	phoneNb:"Please enter a valid phone number" 
                        }, 
                        phonenumber:{
                            required:"Please enter a valid phone number" 
                        } 
                    },
                    groups:{
                        birthDate:"dayOfBirth monthOfBirth yearOfBirth"
                    },
                    errorPlacement: function(error, element) { 
                        if (element.is("#dayOfBirth") || element.is('#monthOfBirth') || element.is('#yearOfBirth')){
                            var pr = element.parent();
                            error.appendTo(jQuery('.fstat',pr));
                        }
                        else if (element.is("#acceptTsAndCs"))
                            error.appendTo(element.parent().next().find('div')); 
                        else
                            error.appendTo(jQuery(element).next());
                    }
                });
            break;
// prepareAccountPassword.aqp
            case "changepass":
                var validator = jQuery(frm).validate({
                    rules:{
                        existingPassword:{required:true, passwd:true, minlength:6},
                        password:{required:true, passwd:true, minlength:6},
                        passwordConfirm:{required:true, passwd:true, minlength:6, equalTo:"#password"}
                    }
                });
            break;
// updateAccountLimits.aqp
            case "acclimits":
                var validator = jQuery(frm).validate({
                    rules:{
                        dailyDepositLimit:{required:true, number:true },
                        monthlyDepositLimit:{required:true, number:true }
                    }
                });
            break;
// prepareBonuses.aqp
            case "bonusawards":
                var validator = jQuery(frm).validate({
                    rules:{voucher:"required" } });
            break;
// prepareCashinBankAccount.aqp
            case "withdrawform":
                var validator = jQuery(frm).validate({
                    rules:{
                        name:{required:true, minlength:2},
                        owner:{required:true, minlength:2},
                        code:{required:true, alphanum:true, minlength:8},
                        sortcode:{required:true, digits:true},
                        iban:{required:true, alphanum:true, minlength:15, maxlength:34},
                        accountno:{required:true, digits:true},
                        amount:{required:true, cashformat:true, min:20}
                    },
                    messages:{
                        name:{
                            required:"Enter the name of your bank!"
                        },
                        owner:{
                            required:"Enter Your name!"
                        },
                        code:{
                            required:"Enter the international bank identifier code of your bank!" 
                        }, 
                        sortcode:{
                            required:"Enter the local sort code of your bank!"
                        },
                        iban:{
                            required:"Enter the International Bank Account Number of your account!" 
                        },
                        accountno:{
                            required:"Enter your bank account number in local format!"
                        },
                        amount:{
                            required:"Enter the amount you want to withdraw!"
                        }
                    },
                    errorPlacement: function(error, element) { 
                        if (element.is("#amount")){
                            var fp = element.parent();
                            var sp = jQuery(fp).parent();
                            error.appendTo(jQuery('.fstat',sp));
                        }
                        else 
                            error.appendTo(jQuery(element).next());
                    }
                });
            break;
// prepareFundAccountMetacharge.aqp
            case "metacharge":             
                var validator = jQuery(frm).validate({
                    rules:{
                        cc1:{required:true, advCCNB:true},
                        cc2:{required:true, advCCNB:true},
                        cc3:{required:true, advCCNB:true},
                        cc4:{required:true, advCCNB:true},
                        cvs:{required:true, ccCvs:true},
                        name:{required:true, minlength:3},
                        amount:{required:true, cashformat:true, min:20, max:500}
                    },
                    groups:{creditCard:"cc1 cc2 cc3 cc4"},
                    showErrors: function(errorMap, errorList) {
                        var nbOfErr = this.numberOfInvalids();
                        if (nbOfErr) {
                            for(i in errorMap){
                                if (i=='cc1'||i=='cc2'||i=='cc3'||i=='cc4'){
                                    myValFunc();
                                }
                            }
                        }
                        this.defaultShowErrors();
                    },                    
                    success:function(label){
                        myValFunc();
                        label.addClass('st-ok');
                    },
                    errorPlacement: function(error, element) { 
                        if (element.is("#cc1") || element.is('#cc2') || element.is('#cc3') || element.is('#cc4')){}
                        else
                            error.appendTo(jQuery(element).next());
                    }
                });
                function myValFunc(){
                    var goodf = 0;
                    jQuery('input','#ccardfields').each(function(){
                        var cval = jQuery(this).attr('value');
                        if (cval.match(/(\d|\*){4}/)){
                            goodf++;
                            jQuery(this).removeClass('st-err');
                        }
                        else{
                            jQuery(this).addClass('st-err');
                        }
                    });
                    (goodf<4)?jQuery('.fstat','#ccardfields').html('<em class="st-err"><!-- CC error --></em>'):jQuery('.fstat','#ccardfields').html('<em class="st-err st-ok"><!-- CC OK --></em>');
                }
            break;
// fundAccountNeteller.aqp
            case "depositNetteler":
                var validator = jQuery(frm).validate({
                    rules:{
                        accountid:{required:true, digitsAndStars:true, minlength:12, maxlength:12},
                        secureid:{required:true, digitsAndStars:true, minlength:6, maxlength:6},
                        amount:{required:true, cashformat:true, min:20, max:500}
                    }
                });
            break;
// fundAccountMoneyBookers.aqp
            case "depositMBookers":
                var validator = jQuery(frm).validate({
                    rules:{
                        amount:{required:true, cashformat:true, min:20, max:500}
                    }
                });
            break;
// fundAccountUKash.aqp
            case "depositUKash":
                var validator = jQuery(frm).validate({
                    rules:{
                        voucherid:{required:true, digits:true, minlength:19},
                        amount:{required:true, cashformat:true, min:10}
                    }
                });
            break;
// fundAccountPaysafe.aqp
            case "depositPaySafe":
                var validator = jQuery(frm).validate({
                    rules:{
                        pin:{required:true, digits:true, minlength:16, maxlength:16},
                        amount:{required:true, cashformat:true, min:10}
                    }
                });
            break;
// prepareCashinCC.aqp
            case "cashinVisa":
                var validator = jQuery(frm).validate({
                    rules:{
                        amount:{required:true, cashformat:true, min:20}
                    },
                    errorPlacement: function(error, element) {
                        if (element.is("#amount")){
                            var fp = element.parent();
                            var sp = jQuery(fp).parent();
                            error.appendTo(jQuery('.fstat',sp));
                        }
                    }
                });
            break;
// prepareCashinNeteller.aqp
            case "cashinNeteller":
                var validator = jQuery(frm).validate({
                    rules:{
                        amount:{required:true, cashformat:true, min:20}
                    },
                    errorPlacement: function(error, element) {
                        if (element.is("#amount")){
                            var fp = element.parent();
                            var sp = jQuery(fp).parent();
                            error.appendTo(jQuery('.fstat',sp));
                        }
                    }
                });
            break;
// prepareCashinMoneyBookers.aqp
            case "cashinMoneybookers":
                var validator = jQuery(frm).validate({
                    rules:{
                        amount:{required:true, cashformat:true, min:20}
                    },
                    errorPlacement: function(error, element) {
                        if (element.is("#amount")){
                            var fp = element.parent();
                            var sp = jQuery(fp).parent();
                            error.appendTo(jQuery('.fstat',sp));
                        }
                    }
                });
            break;
// prepareCashinCheque.aqp
            case "cashinCheque":
                var validator = jQuery(frm).validate({
                    rules:{
                        amount:{required:true, cashformat:true, min:20}
                    },
                    errorPlacement: function(error, element) {
                        if (element.is("#amount")){
                            var fp = element.parent();
                            var sp = jQuery(fp).parent();
                            error.appendTo(jQuery('.fstat',sp));
                        }
                    }
                });
            break;
        }
    }
}




/**
*	swffit v2.0 (10/18/2008) <http://swffit.millermedeiros.com/>
*	Copyright (c) 2008 Miller Medeiros <http://www.millermedeiros.com/>
*	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swffit=function(){var NS=(navigator.appName=='Netscape')?true:false,win=window,doc=document,html=doc.getElementsByTagName('html')[0],_ft,_mw,_mh,_xw,_xh,_hc,_vc;function fit(t,w,h,xw,xh,hc,vc){_ft=t;_mw=w;_mh=h;_xw=xw;_xh=xh;_hc=(hc||hc==null)?true:false;_vc=(vc||vc==null)?true:false;swfobject.createCSS("#"+_ft,"position:absolute; width:100%; height:100%");swfobject.createCSS("#"+_ft+" object","position:absolute");swfobject.addDomLoadEvent(startFit)}function startFit(){html.style.height=doc.body.style.height='100%';html.style.overflow='auto';doc.body.style.margin=doc.body.style.padding='0';if(swfobject.getObjectById(_ft)){_ft=swfobject.getObjectById(_ft)}else if(NS){_ft=doc.getElementById(_ft).getElementsByTagName('object')[0]}else{_ft=doc.getElementById(_ft)}addResizeEvent(resize);swfobject.addDomLoadEvent(resize)}function stopFit(w,h){removeResizeEvent(resize);_ft.style.top=_ft.style.left='auto';_ft.style.marginTop=_ft.style.marginLeft='0';var w=(w==null)?'100%':w,h=(h==null)?'100%':h;setWidth(w);setHeight(h)}function setWidth(w){_ft.style.width=(isNaN(w))?w:w+"px"}function setHeight(h){_ft.style.height=(isNaN(h))?h:h+"px"}function addResizeEvent(fn){if(win.addEventListener){win.addEventListener('resize',fn,false)}else if(win.attachEvent){win.attachEvent('onresize',fn)}}function removeResizeEvent(fn){if(win.removeEventListener){win.removeEventListener('resize',fn,false)}else if(win.detachEvent){win.detachEvent('onresize',fn)}}function resize(){var iw=(NS)?win.innerWidth:doc.body.clientWidth,ih=(NS)?win.innerHeight:doc.body.clientHeight;if(iw>_xw&&_xw){setWidth(_xw);if(_hc){_ft.style.left='50%';_ft.style.marginLeft=-(_xw*.5)+'px'}}else{if(iw>_mw&&(iw<_xw||!_xw)){setWidth('100%')}else{setWidth(_mw)}if(_hc){_ft.style.left='auto';_ft.style.marginLeft='0'}}if(ih>_xh&&_xh){setHeight(_xh);if(_vc){_ft.style.top='50%';_ft.style.marginTop=-(_xh*.5)+'px'}}else{if(ih>_mh&&(ih<_xh||!_xh)){setHeight('100%')}else{setHeight(_mh)}if(_vc){_ft.style.top='auto';_ft.style.marginTop='0'}}}return{addResizeEvent:addResizeEvent,removeResizeEvent:removeResizeEvent,stopFit:stopFit,fit:fit}}();

/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();



