<!--
var urlroot="http://www.sweatyonion.com";

function funCheckFrmAddDate(isPrivate){
  if(document.getElementById('strPerson').value === "" || document.getElementById('strPerson').value == "enter a name here"){
    alert("Please enter a person's name");
    document.getElementById('strPerson').focus();
    document.getElementById('strPerson').value = "";
  }
  else if (document.getElementById('intDay').value === "") {
    alert("Please choose a day");
    document.getElementById('intDay').focus();
  }
  else if (document.getElementById('intMonth').value === "") {
    alert("Please choose a month");
    document.getElementById('intMonth').focus();
  }
  else if (funGetCheckedValue(document.forms[0].elements['strDateType']) === "") {
    alert("Please choose birthday or anniversary");
  }
  else {
    document.getElementById('intIsPrivate').value = isPrivate;
    document.getElementById('frmAddDate').submit();
  }
}

function funGetCheckedValue(radioObj) {
//radioObj = document.getElementById('strDateType');
	if(!radioObj){
		return "";
		}
	var radioLength = radioObj.length;

	if(radioLength == undefined){
		if(radioObj.checked){
			return radioObj.value;
			}
		else{
			return "";
			}
	}
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

//window.name = "sweatyindex";

function opacityDetect() {
if (typeof document.body.style.opacity == 'string'){  // CSS3 compliant (Moz 1.7alpha+, Safari 1.2+, Firefox, Netscape 7.2+)
displayPNGorGIF("png");
}
else if ("filters" in document.body && "alpha" in document.body.filters){ // Internet Exploder
displayPNGorGIF("gif");
}
else if (typeof document.body.style.MozOpacity == 'string'){ // older Mozilla, Netscape 7.1-
displayPNGorGIF("gif");
}
else if (typeof document.body.style.getPropertyValue("-khtml-opacity") == 'string'){ // Konqueror, older Safari
displayPNGorGIF("gif");
}
else{ // opacity not supported
displayPNGorGIF("gif");
}
}

function displayPNGorGIF(extension){
//alert('display a ' + extension);
var identity;
identity = window.document.getElementById("sweatylogo");
identity.src = "../media/sweatyonionlogo." + extension;
}

var curimg = 0;
var t;

function funStartSlideshow(){
document.getElementById("slideshowpic").setAttribute("src", slideshowarray[curimg]);
document.getElementById("slideshowcaption").innerHTML = slideshowcaptions[curimg];
document.getElementById("slideshoworiginal").innerHTML = "<a href='"+slideshoworiginal[curimg]+"'>download the best quality</a>";
document.getElementById("slideshowlink").innerHTML = '<a href="javascript:void(0)" onClick="funStopSlideshow();">pause slideshow</a>';
curimg=(curimg<slideshowarray.length-1)? curimg+1 : 0;
t=setTimeout("funStartSlideshow()",3000);
}

function funStopSlideshow(){
clearTimeout(t);
document.getElementById("slideshowlink").innerHTML = '<a href="javascript:void(0)" onClick="funStartSlideshow();">play slideshow</a>';
}

function funDisplayMessage(){
 	var strUrl = window.location.href;
	var strMessageStart = strUrl.indexOf("message=");
	if (strMessageStart > 0) {
 		var strMessageEnd = strUrl.length;
		var strMessageCode = strUrl.substring(strMessageStart+8,strMessageEnd);
		var strMessage;
		switch(strMessageCode){
			case "adddate" : strMessage = "Your person has just been added!"; break;
			case "publicdate" : strMessage = "You've just made your person available to everyone!"; break;
			case "deletedate" : strMessage = "You've just deleted your person for good"; break;
			case "privatedate" : strMessage = "You've just hidden your person from everyone else!"; break;
			default: break;
		}
		alert(strMessage);
	}
}


document.cookie = "treepos=Unknown";
document.cookie = "iconcolour=Unknown";

function ShowSummary(SelectedPic,SummaryText) { //v2.0

  var d = document.getElementById("InfoBox");
  var p = document.getElementById(SelectedPic);
  var i = SelectedPic.replace("LayerTreePos","icon");
  i = document.getElementById(i);
  var leftmargin = (window.innerWidth - 753)/2;
  d.style.left = (leftmargin+parseInt(p.style.left,10)) + "px";
  d.style.top = parseInt(p.style.top,10)+60 + "px";

  var ck = document.cookie;
  var tpstart = ck.indexOf("treepos=");
  var icstart = ck.indexOf("iconcolour=");
  var end = ck.indexOf(".gif");
  var cktreepos = ck.substring(tpstart+8,icstart-2);
  var ckiconcolour = ck.substring(icstart+11,end+4);

  if (cktreepos != "Unknown"){
  document.getElementById(cktreepos).src = ckiconcolour;
  }

  document.cookie = "treepos="+i.id;
  document.cookie = "iconcolour="+i.src;
  i.src = urlroot + "/media/selectedicon.gif";

  //if (mousex > 175) {
  //d.style.left = 150;
  //d.style.top = mousey-30;
  //}
  //else {
  //d.style.left = mousex;
  //d.style.top = p.style.top + 10;
  //}

  d.style.visibility = "visible";
  d.innerHTML = unescape(SummaryText);
}

function HideSummary() { //v2.0
  var d = document.getElementById("InfoBox");
  d.style.visibility = "hidden";
}

function funLoginWindow(dest,start){
	open("/scripts/login.php?dest="+dest+"&start="+start,'','scrollbars=0,resizable=0,width=410,height=300');
}

function funClear(obj,defaultValue){
		if (obj.value == defaultValue) {
    		obj.value = "";
    	}
}

function funEditDate(action,theid){
    document.getElementById('strAction').value = action;
    document.getElementById('intEditID').value = theid;
    document.getElementById('frmSelectedDates').submit();
}

function funRemoveDate(myname){
var mystr = document.frmSelectedDates.elements["h"+myname].value;
	if (mystr !== "") {
	document.frmSelectedDates.elements["h"+myname].value = "";
	}
	else {
	document.frmSelectedDates.elements["h"+myname].value = myname.substring(1,myname.length);
	}
alert(document.frmSelectedDates.elements[myname].value+" and the hidden field is "+document.frmSelectedDates.elements["h"+myname].value);
}

function funLogOut(currentpage){
	window.location.href='http://localhost/scripts/logout.php?returnpage='+currentpage;
}

/**
 *
 * @access public
 * @return void
 **/
function funStartAnimatedGif(theid){

	if (theid.substr(0,3)=="but") {
		theid = theid.replace("but","");
	}

	var thesrc = document.getElementById(theid).src;
	thesrc = thesrc.replace("http://www.sweatyonion.com","");

	if (thesrc.substr(thesrc.length-3,3) == "jpg") {

			var newsrc = document.getElementById(theid).src;
			newsrc = newsrc.replace("/scripts/gifplaybutton.php?img=","");
			newsrc = newsrc.replace(".6.jpg",".1.gif");
			document.getElementById(theid).src = newsrc;
	}
	else {
			document.getElementById(theid).src = "/scripts/gifplaybutton.php?img="+thesrc.replace(".1.gif",".6.jpg");
	}
}

// STYLING FILE INPUTS 1.0 | Shaun Inman <http://www.shauninman.com/> | 2007-09-07
if (!window.SI) { var SI = {}; }
SI.Files =
{
	htmlClass : 'SI-FILES-STYLIZED',
	fileClass : 'bloggsquadformfile',
	wrapClass : 'cabinet',

	fini : false,
	able : false,
	init : function()
	{
		this.fini = true;

		var ie = 0 //@cc_on + @_jscript_version
		if (window.opera || (ie && ie < 5.5) || !document.getElementsByTagName) {
		return;
		} // no support for opacity or the DOM
		this.able = true;

		var html = document.getElementsByTagName('html')[0];
		html.className += (html.className !== '' ? ' ' : '') + this.htmlClass;
	},

	stylize : function(elem)
	{
		if (!this.fini) { this.init(); }
		if (!this.able) { return; }

		elem.parentNode.file = elem;
		elem.parentNode.onmousemove = function(e)
		{
			if (typeof e == 'undefined'){
			e = window.event;
			}
			if (typeof e.pageY == 'undefined' &&  typeof e.clientX == 'number' && document.documentElement)
			{
				e.pageX = e.clientX + document.documentElement.scrollLeft;
				e.pageY = e.clientY + document.documentElement.scrollTop;
			}

			var ox = oy = 0;
			var elem = this;
			if (elem.offsetParent)
			{
				ox = elem.offsetLeft;
				oy = elem.offsetTop;
				while (elem == elem.offsetParent)
				{
					ox += elem.offsetLeft;
					oy += elem.offsetTop;
				}
			}

			var x = e.pageX - ox;
			var y = e.pageY - oy;
			var w = this.file.offsetWidth;
			var h = this.file.offsetHeight;


			this.file.style.top		= '0px';
			this.file.style.left	= '0px';

			//this.file.style.top		= y - (h / 2)  + 'px';
			//this.file.style.left	= x - (w - 30) + 'px';
		};
	},

	stylizeById : function(id)
	{
		this.stylize(document.getElementById(id));
	},

	stylizeAll : function()
	{
		if (!this.fini) { this.init(); }
		if (!this.able) { return; }

		var inputs = document.getElementsByTagName('input');
		for (var i = 0; i < inputs.length; i++)
		{
			var input = inputs[i];
			if (input.type == 'file' && input.className.indexOf(this.fileClass) != -1 && input.parentNode.className.indexOf(this.wrapClass) != -1)
			{
				this.stylize(input);
			}
		}
	}
}

function funDisplayFilename(myid){

var filepath = myid.value;
var filename = filepath;
var lastslash = filepath.lastIndexOf("\\")+1;
if (lastslash>0) {
	filename = filepath.substr(lastslash);
}
document.getElementById(myid.name+"NameDestination").innerHTML = "You have chosen <span class='bold'>"+filename+"</span>";
}

function funCheckBloggForm(){

if (document.getElementById("strTitle").value=="enter a title here" ||document.getElementById("strTitle").value=== "") {
		alert("come on slacker - enter a title where it says 'enter a title here'");
		document.getElementById("strTitle").value = null;
		document.getElementById("strTitle").focus();
		return false;
	}
	else if(document.getElementById("strText").value=="enter text for your blogg here" || document.getElementById("strText").value=== "") {
			alert("'ere don't forget to type something in the big box. This is what people will read after all.");
			document.getElementById("strText").value = null;
			document.getElementById("strText").focus();
			return false;
	}
}


function funCheckStuffForm(){

if (document.getElementById("strCollection").value=="enter a name for a new collection" ||document.getElementById("strCollection").value=== "") {
		alert("enter a name for a new collection");
		document.getElementById("strCollection").value = null;
		document.getElementById("strCollection").focus();
		return false;
	}
	else if (document.getElementById("strFile1NameDestination").innerHTML=="to go with your collection") {
	alert("choose a file before clicking on the add your stuff button");
	return false;
	}
	else{
	UP.start();
	}
}

var nfilesforstuffform = 2;

function funExpandStuffForm() {

   var label1 = document.createElement('LABEL');
   label1.className = 'cabinet';

   var file1 = document.createElement('INPUT');
   file1.type = 'file';
   file1.name = 'strFile' + nfilesforstuffform;
   file1.id = 'strFile' + nfilesforstuffform;
   file1.className = 'bloggsquadformfile';
   file1.setAttribute("onchange", "funDisplayFilename(this);");

   var span1 = document.createElement('SPAN');
   span1.id = 'strFile' + nfilesforstuffform + 'NameDestination';

   var text1 = document.createTextNode(' to go with your collection');

   var script1 = document.createElement('SCRIPT');
   script1.type = 'text/javascript';
   script1.text = 'SI.Files.stylizeAll();';
   script1.defer = true;

   var br1 = document.createElement('BR');

   var caption1 = document.createElement('INPUT');
   caption1.type = 'text';
   caption1.name = 'strCaption' + nfilesforstuffform;
   caption1.id = 'strCaption' + nfilesforstuffform;
   caption1.className = 'bloggsquadforminputcaption';
   caption1.setAttribute("onclick", "funClear(this,'enter a caption to go with your file');");
   caption1.value = 'enter a caption to go with your file';

   var text3 = document.createTextNode(' year the file records ');

   var mediayear1 = document.createElement('INPUT');
   mediayear1.type = 'text';
   mediayear1.name = 'intMediaYear' + nfilesforstuffform;
   mediayear1.id = 'intMediaYear' + nfilesforstuffform;
   mediayear1.className = 'bloggsquadforminputyear';
   var lastyear = nfilesforstuffform - 1;
   mediayear1.value = document.getElementById("intMediaYear"+lastyear).value;

   document.getElementById('inserthere').appendChild(label1);
   label1.appendChild(file1);
   document.getElementById('inserthere').appendChild(span1);
   span1.appendChild(text1);
   document.getElementById('inserthere').appendChild(script1);
   document.getElementById('inserthere').appendChild(br1);
   document.getElementById('inserthere').appendChild(caption1);
   document.getElementById('inserthere').appendChild(text3);
   document.getElementById('inserthere').appendChild(mediayear1);

   nfilesforstuffform = nfilesforstuffform+1;

}

/***A more elegant implementation of google analytics - by Al Stevens 20 July 2008***/


/* Simplifies onload, you will no longer have to add an onload event call just call addLoadEvent */
function addLoadEvent(func,arg){

if (!arg){
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
}
}
  else{/*if the onload event has an argument/parameter cater for that*/
  if (arg){
  oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func(arg);
	}
     window.onload = function() {
      oldonload();
      func(arg);
    }
  }
}
}
function loadGAScript(){
	/*Check browser for Dom compatibility*/
if (!document.getElementsByTagName){
 return false;
 }
/*Determines whether the page is using a secure or unsecure protocol*/
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
/*Writes in the script to the document head*/
var gaScript = document.createElement("script");
gaScript.setAttribute("src",gaJsHost +"google-analytics.com/ga.js");
gaScript.setAttribute("type","text/javascript");
var domHead = document.getElementsByTagName("head")[0]
domHead.appendChild(gaScript);
	}
	loadGAScript();

/*Calls the analytics function*/
function callGA(){
//code that I get from google
try {
var pageTracker = _gat._getTracker("UA-7978155-1");
pageTracker._trackPageview();
} catch(err) {}
//code that I get from Al Stevens
//var pageTracker = _gat._getTracker("UA-7978155-1");
//pageTracker._initData();
//pageTracker._trackPageview();
}

addLoadEvent(callGA);

function writeProgress2(percent,message){
		var barDiv = document.getElementById("barDiv");
		var infoDiv = document.getElementById("infoDiv");
        barDiv.style.width = 4*percent+'px';
        infoDiv.innerHTML = '&nbsp;&nbsp;'+percent+'%'+message;
}

      function addEvent(obj ,evt, fnc)
      {
        if (obj.addEventListener){
          obj.addEventListener(evt,fnc,false);
          }
        else if (obj.attachEvent){
          obj.attachEvent('on'+evt,fnc);
          }
        else {
          return false;
          }
          //may bet pulled up to follow the false statement in the else statement
        return true;
      }

      function removeEvent(obj ,evt, fnc)
      {
        if (obj.removeEventListener){
          obj.removeEventListener(evt,fnc,false);
          }
        else if (obj.detachEvent){
          obj.detachEvent('on'+evt,fnc);
          }
        else{
          return false;
          }
        return true;
      }

      //----------

      function appendElement(node,tag,id,htm)
      {
        var ne = document.createElement(tag);
        if(id){
		ne.id = id;
		}
        if(htm){
		 ne.innerHTML = htm;
		 }
        node.appendChild(ne);
      }

      //----------

      function showSpotlight(p,manageri,roundno,roundcurrent)
      {
        //greyout(true);
        var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        obj = document.getElementById(p);
          obj.style.position = 'absolute';
          obj.style.left = (((cw-716)/2)+124)+'px';
          obj.style.top = (((roundcurrent-roundno+1)*220))+'px';
          obj.style.display = 'block';
          obj.style.opacity = '.95';
          obj.style.filter = 'alpha(opacity=95)';
          var thearray = 'managerStats'+roundno;
          document.getElementById(p).innerHTML = this[thearray][manageri]+'</table></div><div style="clear:both">&nbsp;</div>';
      }

      function showMe(p){
	    var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        obj = document.getElementById(p);
          obj.style.position = 'absolute';
          obj.style.left = (((cw-716)/2)+210)+'px';
          if (window.location == "http://www.sweatyonion.com/index.php") {
          	 obj.style.top = '55px';
          }
          else {
             obj.style.top = '25px';
          }

          obj.style.display = 'block';
          obj.style.opacity = '.95';
          obj.style.filter = 'alpha(opacity=90)';
 }

function funReloadPage() {
  location.reload(true)
}

      function hideSpotlight(p)
      {
        //greyout(false);
        document.getElementById(p).style.display = 'none';
      }

      //----------

      function showPopup(p)
      {
        greyout(true);
        var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        obj = document.getElementById(p);
          obj.style.position = 'absolute';
          obj.style.left = (((cw-716)/2)-24)+'px';
          obj.style.display = 'block';
      }

      function hidePopup(p)
      {
        greyout(false);
        document.getElementById(p).style.display = 'none';
      }

      //----------

      function greyout(d,z)
      {
        var obj = document.getElementById('greyout');

        if(!obj)
        {
          appendElement(document.body,'div','greyout');
          obj = document.getElementById('greyout');
          obj.style.position = 'absolute';
          obj.style.top = '0px';
          obj.style.left = '0px';
          obj.style.background = '#111';
          obj.style.opacity = '.7';
          obj.style.filter = 'alpha(opacity=70)';
        }
        if(d)
        {
          var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
          var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
          var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
          if(document.body.scrollHeight){
		   sh = Math.max(sh,document.body.scrollHeight);
		   }
          var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
          if(document.body.scrollWidth){
		   sh = Math.max(sh,document.body.scrollWidth);
		   }
          var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
          if(!z){ z = 50 }
          obj.style.zIndex = z;
          obj.style.height = Math.max(wh,Math.max(sh,ch))+'px';
          obj.style.width  = Math.max(sw,cw)+'px';
          obj.style.display = 'block';
          addEvent(window,'resize',greyoutResize);
        }
        else
        {
          obj.style.display = 'none';
          removeEvent(window,'resize',greyoutResize);
        }
      }

      function greyoutResize()
      {
        var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
        var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
        if(document.body.scrollHeight){
		 sh = Math.max(sh,document.body.scrollHeight);
		 }
        var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
        if(document.body.scrollWidth){
		 sh = Math.max(sh,document.body.scrollWidth);
		 }
        var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
        var obj = document.getElementById('greyout');
        obj.style.height = ch+'px';
        obj.style.width  = cw+'px';
        obj.style.height = Math.max(wh,Math.max(sh,ch))+'px';
        obj.style.width  = Math.max(sw,cw)+'px';
      }

function getSelection(ta)
  { var bits = [ta.value,'','',''];
    if(document.selection)
      {
	  var vs = '#$%^%$#';
        var tr=document.selection.createRange()
        if(tr.parentElement()!=ta){
		 return null;
		 }
        bits[2] = tr.text;
        tr.text = vs;
        fb = ta.value.split(vs);
        tr.moveStart('character',-vs.length);
        tr.text = bits[2];
        bits[1] = fb[0];
        bits[3] = fb[1];
      }
    else
      {
	  //if(ta.selectionStart == ta.selectionEnd){
	  // alert("no selection");
	   //return null;

	   //}
        bits=(new RegExp('([\x00-\xff]{'+ta.selectionStart+'})([\x00-\xff]{'+(ta.selectionEnd - ta.selectionStart)+'})([\x00-\xff]*)')).exec(ta.value);
      }
     return bits;
  }

function matchPTags(str)
  { str = ' ' + str + ' ';
    ot = str.split(/\[[B|U|I].*?\]/i);
    ct = str.split(/\[\/[B|U|I].*?\]/i);
    return ot.length==ct.length;
  }

function addPTag(pTag,link)
  {
     if ( link === undefined ) {
      link = 'none';
   }
   ta = document.getElementById('strText');
          switch(pTag){
          case "b":
          pTagStart = "<span class='bold'>";
          pTagEnd = "</span>";
          break;
          case "s":
          pTagStart = "<span class='strikethrough'>";
          pTagEnd = "</span>";
          break;
          case "l":
          pTagStart = '<a href="';
          pTagEnd = '</a>';
          break;
          case "p":
          hidePopup('popup');
          //stuffPath = "http://www.sweatyonion.com/media/"+link+".9.jpg";
          pTagStart = "<object id='media"+link+"'/>";
          pTagEnd = "";
          break;
          default:
          break;
          }

  bits = getSelection(ta);
    if(bits)
      { if(!matchPTags(bits[2]))
          { alert('\t\tInvalid Selection\nSelection contains unmatched opening or closing tags.');
            return;
          }
		  if (pTag=="l"){
		  pTagMiddle = '">'+bits[2].replace("http://","");
		  pTagMiddle = pTagMiddle.replace("www.","");
		  if (bits[2].indexOf("http://")== -1){
		  pTagStart = pTagStart + "http://";
		  }
		  if (bits[2].indexOf("www.")== -1){
		  pTagStart = pTagStart + "www.";
		  }
		  ta.value = bits[1] + pTagStart + bits[2] + pTagMiddle + pTagEnd+ bits[3];
		  }
		  else{
          ta.value = bits[1] + pTagStart + bits[2] + pTagEnd + bits[3];
          }
          funShowPreview();
      }
  }

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

var xmlHttpDrawnPlayers
var xmlHttpMessageBoard

function funShowDrawnPlayers(str)
{
if (str.length==0)
{
document.getElementById("drawrow").innerHTML=""
return
}
xmlHttpDrawnPlayers=GetXmlHttpObject()
if (xmlHttpDrawnPlayers==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="/scripts/getDrawnPlayers.php"
url=url+"?round="+str
url=url+"&sid="+Math.random()
xmlHttpDrawnPlayers.onreadystatechange=stateChangedDrawnPlayers
xmlHttpDrawnPlayers.open("GET",url,true)
xmlHttpDrawnPlayers.send(null)
}

function stateChangedDrawnPlayers()
{
if (xmlHttpDrawnPlayers.readyState==4 || xmlHttpDrawnPlayers.readyState=="complete")
{
document.getElementById("drawrow").innerHTML=xmlHttpDrawnPlayers.responseText
}
}

function funShowMessageBoard(str)
{
if (str.length==0)
{
document.getElementById("messageboard").innerHTML=""
return
}
xmlHttpMessageBoard=GetXmlHttpObject()
if (xmlHttpMessageBoard==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="/scripts/getCupMessageBoard.php"
url=url+"?round="+str
url=url+"&sid="+Math.random()
xmlHttpMessageBoard.onreadystatechange=stateChangedMessageBoard
xmlHttpMessageBoard.open("GET",url,true)
xmlHttpMessageBoard.send(null)
}

function stateChangedMessageBoard()
{
if (xmlHttpMessageBoard.readyState==4 || xmlHttpMessageBoard.readyState=="complete")
{
document.getElementById("messageboard").innerHTML=xmlHttpMessageBoard.responseText
}
}

function funShowPreview()
{
var strTitle = document.getElementById('strTitlePrefix').value;
var str = document.getElementById('strText').value;
str=str.replace(/&lt;/g,'<');
str=str.replace(/&gt;/g,'>');
str=str.replace(/&/g,'%26');
str=str.replace(/\n/g,"<br/>").replace(/\r/g,"");
if (str.length==0)
{
document.getElementById("strTextPreview").innerHTML=""
return
}
xmlHttpPreviewPane=GetXmlHttpObject()
if (xmlHttpPreviewPane==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="/scripts/getPreviewPane.php"
url=url+"?ft="+str+"&sid="+Math.random()
xmlHttpPreviewPane.onreadystatechange=stateChangedPreviewPane
xmlHttpPreviewPane.open("GET",url,true)
xmlHttpPreviewPane.send(null)
}

function stateChangedPreviewPane()
{
if (xmlHttpPreviewPane.readyState==4 || xmlHttpPreviewPane.readyState=="complete")
{
document.getElementById("strTextPreview").innerHTML="<span class='bold'>"+document.getElementById('strTitlePrefix').value+' '+document.getElementById('strTitle').value+'</span><br/>'+xmlHttpPreviewPane.responseText
}
}

var xmlHttpInfoPane

/**
 *
 * @access public
 * @return void
 **/

function funShowPIAXP(inttid,editflag)
{
//alert(inttid);
qs = window.location.search.substring(1);
if (qs.indexOf("faction=edit")<0) {
var str = document.getElementById('infopane').innerHTML;
//str=str.replace(/&lt;/g,'<');
//str=str.replace(/&gt;/g,'>');
//alert (str)
if (str.length==0)
{
document.getElementById("infopane").innerHTML=""
return
}
xmlHttpInfoPane=GetXmlHttpObject()
if (xmlHttpInfoPane==null)
{
alert ("Browser does not support HTTP Request")
return
}
if (editflag == 1) {
	var action="&faction=edit";
}
else{
var action = "";
}
var url="/scripts/getPIAXPPane.php"
url=url+"?fid="+inttid+action+"&sid="+Math.random()
//alert(url)
xmlHttpInfoPane.onreadystatechange=stateChangedInfoPane
xmlHttpInfoPane.open("GET",url,true)
xmlHttpInfoPane.send(null)
}
}

function stateChangedInfoPane()
{
if (xmlHttpInfoPane.readyState==4 || xmlHttpInfoPane.readyState=="complete")
{
document.getElementById("infopane").innerHTML=xmlHttpInfoPane.responseText
}
}

function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
//-->
