<!--
// Begin: Previously KraftCanada.js -------------------------------------------------------------------------------------------

	//BUSTS the page out of a frameset.
	// ??? should this be back in?
	//if (self.location != top.location) {
	//	top.location = self.location;
	//}

function openCustomWin(urly,wid,ht,topz,leftz,namaroni,scrl) {
	pd = "";
	tf = pd + urly;
	nw = window.open(tf,namaroni,"width=" + wid + ",height=" + ht + ",top=" + topz + ",left=" + leftz + ",scrollbars=" + scrl);
}
	
function openNewWin(wurl)
{
	newWindow=window.open(wurl);
}

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_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_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];}
}

// This should no longer be applicable
//MM_preloadImages('/assets/images/nav/nav_chinese_on.gif');


function clearSearchText(txt)
{
	if ((txt.value == "search") || (txt.value == "recherche"))
		txt.value = "";
}

// 
var hasClickedSubmit = false;
var msg = "Did you make any changes to your profile?  Click 'OK' to save your profile changes.";
	
function unLoadVerify()
{
	
	if (!hasClickedSubmit) {
		if (window.confirm(msg)) {
			var btnSubmit = document.getElementById('EditProfile1_cmdUpdate');
			btnSubmit.click();
			
		}
	}
}

function killDoubleClick()
{
	if (!hasClickedSubmit) {
		hasClickedSubmit = true;
		return true;
	}
	return false;
}

// End: Previously KraftCanada.js -------------------------------------------------------------------------------------------


function winopen(wurl,wname,wfeatures)
{
   newWindow=window.open(wurl,wname,wfeatures);
}

function select_url(x)
{
    parent.location.href = x;
}

function open_window_sm(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();

}

function open_window_scroll(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();
}

function open_window_sm(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();

}

function open_window_scroll(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();
}

function getMilliseconds() {

dot = new Date(0);
now = new Date();
t = (now - dot);
return(t);

}

function getHyperloadDcr(dcr){
dcr = dcr +"?" +getMilliseconds();
return dcr;

}

function PrintGameTag(dcr, width, height, bgcolor, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9, swlist, version, menu) {
	if (!(sw1)) { sw1 = ""; }
	if (!(sw2)) { sw2 = ""; }
	if (!(sw3)) { sw3 = ""; }
	if (!(sw4)) { sw4 = ""; }
	if (!(sw5)) { sw5 = ""; }
	if (!(sw6)) { sw6 = ""; }
	if (!(sw7)) { sw7 = ""; }
	if (!(sw8)) { sw8 = ""; }
	if (!(sw9)) { sw9 = ""; }
	if (!(swlist)) { swlist = ""; }

	document.write('   <OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=' + version + '" WIDTH="' + width + '" HEIGHT="' + height + '">	');
	document.write('   <PARAM NAME="SRC" VALUE="' + dcr + '">	');
	document.write('   <PARAM NAME="BGCOLOR" VALUE="' + bgcolor + '">	');
	document.write('   <PARAM NAME="SW1" VALUE="' + sw1 + '">	');
	document.write('   <PARAM NAME="SW2" VALUE="' + sw2 + '">	');
	document.write('   <PARAM NAME="SW3" VALUE="' + sw3 + '">	');
	document.write('   <PARAM NAME="SW4" VALUE="' + sw4 + '">	');
	document.write('   <PARAM NAME="SW5" VALUE="' + sw5 + '">	');
	document.write('   <PARAM NAME="SW6" VALUE="' + sw6 + '">	');
	document.write('   <PARAM NAME="SW7" VALUE="' + sw7 + '">	');
	document.write('   <PARAM NAME="SW8" VALUE="' + sw8 + '">	');
	document.write('   <PARAM NAME="SW9" VALUE="' + sw9 + '">	');
	document.write('   <PARAM NAME="SWLIST" VALUE="' + swlist + '">	');
	if (menu == 0) {
		document.write('   <PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'">	');
		document.write('   <EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	} else {
		document.write('   <PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'">	');
		document.write('   <EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	}
	document.write('   </OBJECT>	');
}

function writeFlashTag(movie, width, height, bgcolor, paramstring) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">');
	source = movie
	if ((paramstring != null) && (paramstring != "")) {
		source = source + "?" + paramstring;
	}
	document.write('  <PARAM NAME=movie VALUE="' + source + '">');
	document.write('  <PARAM NAME=quality VALUE=high>'); 
	document.write('  <PARAM NAME=menu VALUE=false>'); 
	document.write('  <PARAM NAME=bgcolor VALUE="#' + bgcolor + '">');
	document.write('  <EMBED src="' + source + '" quality=high menu=false bgcolor=#' + bgcolor + ' WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.write('</OBJECT>');
}

var buttonCounter = 0;
function OneButtonClick() {
	if (buttonCounter == 0) {
		buttonCounter = 1;
		return true;
	} else {
		return false;
	}
}

function containsNoBad( instring ) {
    badChars = "<>";
    for (var i=0; i< instring.length; i++) {
       if (badChars.indexOf(instring.charAt(i)) != -1) {
          return false;
       }
    }
    return true;
}
	
function navChange(imgName,imgSrc){
	document.images[imgName].src = imgSrc;
}

function navChangeAlt(inputName,imgSrc){
	document.getElementById(inputName).src = imgSrc;
}

function colorOver(id,type){
	if(type == "featured"){
		document.getElementById(id).style.backgroundColor='#d7e7f4';
	}
	else{
		document.getElementById(id).style.backgroundColor='#ffffff';
	}
}

function colorOff(id,type){
	if(type == "featured"){
		document.getElementById(id).style.backgroundColor='#ffffff';
	}
	else{
		document.getElementById(id).style.backgroundColor='#d7e7f4';
	}
}

function inArray(thearray, searchfor) {
	var found = false;

	if (thearray.length > 0) {
		var arraystring = '@' + thearray.join('@');
		found = (arraystring.indexOf('@' + searchfor) > -1)
	}
	return found
}

function doSubmit(event,btn)
{
	
	if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13))
	{ 
	
		if (navigator.appName == "Netscape")
		{
			btn = btn.replace(/:/g, "_");
		}

		document.getElementById(btn).click();
		return false;
	} 
	return true; 
}

function makeDefaultTextBox(txt)
{
	document.getElementById(txt).focus();
}

function getfile(filename,divname,layername) 
{
   var nn4 = (document.layers);
   var nn6 = (document.getElementById && !document.all);
   var ie4 = (document.all && !document.getElementById);
   var ie5 = (document.all && document.getElementById);

   if (nn4){
      eval('parent.document.' + divname + '.layers.' + layername + '.load(filename, parent.document.' + divname + '.layers.' + layername + '.clip.width)');
   }
   else if (ie4) eval('parent.document.all.' + divname + '.document.frames[layername].location = filename');
   else if (ie5 || nn6) parent.document.getElementById(layername).src = filename;
}

function trimright(s) {
	while (s.charAt(s.length -1) == ' ') {
		s = s.substring(0, s.length-1);		
	}
	return s;
}

function loadNewPage(ddl) {
	window.location = ddl[ddl.selectedIndex].value;
}

// -->
