




/*This too is very sad that this isn't part of the DOM core functionality. But hey, it makes for fun references like this! This function however isn't quite a function; it's a prototype that extends the DOM Array object. I remember one day thinking to myself surely I can do this in PHP, it's gotta be in JavaScript. Well, this extension makes it work just like you'd expect if you're a PHP developer.*/
/*Array.prototype.inArray = function (value) {
	for (var i=0; i < this.length; i++) if (this[i] === value) return true;
	return false;
};*/
function getfreeslot(slotsarray,dupid) {
	if (dupid!='') for (var c1=0;c1<=slotsarray.length-1;c1++) if (slotsarray[c1]==dupid) return c1;
	for (var c1=0;c1<=slotsarray.length-1;c1++) if (slotsarray[c1]==-1) return c1;
	return -1;
}





/*
The dollar functions is a simple way to grab an element quickly. So instead of document.getElementById('a');, you'd simply just do this instead:$('a');
And if you wanted a whole collection of elements, you can simply do this: $('a','b',obj,obj2,'c','d');
*/
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string') element = document.getElementById(element);
		if (arguments.length == 1) return element;
		elements.push(element);
	}
	return elements;
}
/*
This function was spawned from developers needing a quick and elegant way of grabbing elements by a className
Simply add a class name to the beginning of the funciton and the 2nd and 3rd arguments are optional and the magic is done for you!
*/
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
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 eleexists(eleid) {
	if (document.getElementById(eleid)) return true;
	else return false;
}
function finddupid() {
	var allele=document.getElementsByTagName("*");
	for (var c1=0;c1<=allele.length-1;c1++) {
		for (var c2=0;c2<=allele.length-1;c2++) {
			if (allele[c1].id&&allele[c2].id&&allele[c1].id==allele[c2].id&&c1!=c2) {
				alert('! DUP ID FOUND: '+allele[c1].id+' !');
				return;
			}
		}
	}
	alert('[ NO DUP ID FOUND ]');
}





function addele(peleid,beforeid,tag) {
	var pele=document.getElementById(peleid);
	var nele=0;
	var bele=0; if (beforeid&&beforeid!='') bele=document.getElementById(beforeid);
	var ar=arguments; var att=''; var val=''; var textn='';
	if (tag=='text'&&ar[3]&&ar[3]!='') nele=document.createTextNode(ar[c3]);
	if (tag!='text') { nele=document.createElement(tag);
		for (var c1=3;c1<=ar.length-1;c1++) { if (ar[c1].search('=')!=-1) {
			att=ar[c1].substr(0,ar[c1].indexOf('='));
			val=ar[c1].substr(att.length+1,ar[c1].length-att.length-1);
			if (att.toLowerCase()=='style'&&isie()&&nele.style.cssText!=null) nele.style.cssText=val;
			if (!(att.toLowerCase()=='style'&&isie())) {
				if (nele.getAttribute(att)==null||nele.getAttribute(att)==''||!nele.getAttribute(att)) {
					var natt=0; natt=document.createAttribute(att); natt.nodeValue=val; nele.setAttributeNode(natt);
				}
				else nele.setAttribute(att,val);
			}
		}}
	}
	if (bele) pele.insertBefore(nele,bele);
	else pele.appendChild(nele);
}
function insertAfter(parent, node, referenceNode) {
	parent.insertBefore(node, referenceNode.nextSibling);
}
function copyele(eleid,targetparentid,beforeid,newid,removeoele) {
	var ele=document.getElementById(eleid);
	var eleclone=ele.cloneNode(true);
	if (newid&&newid!='') {
		if (eleclone.getAttribute('id')==null||eleclone.getAttribute('id')==''||!eleclone.getAttribute('id')) {
			var nid=0; nid=document.createAttribute('id'); nid.nodeValue=newid; eleclone.setAttributeNode(nid);
		}
		else eleclone.setAttribute('id',newid);
	}
	var tp=document.getElementById(targetparentid);
	var bele=0; if (beforeid&&beforeid!='') bele=document.getElementById(beforeid);
	if (bele) tp.insertBefore(eleclone,bele);
	else tp.appendChild(eleclone);
	var op=0; if (ele.parentNode) op=ele.parentNode; else if (ele.parentElement) op=ele.parentElement;
	if (op&&removeoele) op.removeChild(ele);
}
function removeele(eleid) {
	var ele=document.getElementById(eleid);
	var pele=0; if (ele.parentNode) pele=ele.parentNode; else if (ele.parentElement) pele=ele.parentElement;
	if (pele&&ele) pele.removeChild(ele);
}
function emptyele(nodeid) {
	var node=document.getElementById(nodeid);
	if (node.hasChildNodes()) while (node.childNodes.length>=1) node.removeChild(node.firstChild);
}





function addatt(eleid,att,val) {
	var ele=document.getElementById(eleid);
	var natt=document.createAttribute(att);
	natt.nodeValue=val;
	ele.setAttributeNode(natt); 
}
function getatt(eleid,att) {
	return document.getElementById(eleid).getAttribute(att);
}
function setatt(eleid,att,val) {
	var ele=document.getElementById(eleid);
	if (ele.getAttribute(att)==null||ele.getAttribute(att)==''||!ele.getAttribute(att)) addatt(eleid,att,val);
	else ele.setAttribute(att,val);
}
function gethtml(eleid) {
	return document.getElementById(eleid).innerHTML;
}
function sethtml(eleid,html) {
	document.getElementById(eleid).innerHTML=html;
}
function getstyle(eleid) {
	var ele=document.getElementById(eleid);
	if (isie()&&ele.style.cssText!=null) return ele.style.cssText;
	else return ele.getAttribute('style');
}
function setstyle(eleid,styletext) {
	var ele=document.getElementById(eleid);
	if (isie()&&ele.style.cssText!=null) ele.style.cssText=styletext;
	else setatt(eleid,'style',styletext);
}
function addevent(obj,type,fn) {
	if (obj.attachEvent) {
		obj['e'+type+fn]=fn;
		obj[type+fn]=function(){obj['e'+type+fn](window.event);}
		obj.attachEvent('on'+type,obj[type+fn]);
	} else obj.addEventListener(type,fn,false);
}
function removeevent(obj,type,fn) {
	if (obj.detachEvent) {
		obj.detachEvent('on'+type,obj[type+fn]);
		obj[type+fn]=null;
		obj['e'+type+fn]=null;
	} else obj.removeEventListener(type,fn,false);
}
var ehfunc=new Array();
var eheleid=new Array();
var ehtrigger=new Array();
var ehtotal=100;
for (var c1=0;c1<=ehtotal-1;c1++) {
	ehfunc[c1]=-1;
	eheleid[c1]=-1;
	ehtrigger[c1]=-1;
}
function getnewehid() {
	return getfreeslot(ehfunc,'');
}
function addeventv2(ehid,eleid,type,fn) {
	if (ehid==-1) return;
	ehfunc[ehid]=fn;
	eheleid[ehid]=eleid;
	ehtrigger[ehid]=type;
	var obj=document.getElementById(eheleid[ehid]);
	if (obj.attachEvent) obj.attachEvent('on'+ehtrigger[ehid],ehfunc[ehid]);
	else obj.addEventListener(ehtrigger[ehid],ehfunc[ehid],false);
}
function removeeventv2(ehid) {
	if (ehid==-1) return;
	var obj=document.getElementById(eheleid[ehid]);
	if (obj.detachEvent) obj.detachEvent('on'+ehtrigger[ehid],ehfunc[ehid]);
	else obj.removeEventListener(ehtrigger[ehid],ehfunc[ehid],false);
	ehfunc[ehid]=-1;
	eheleid[ehid]=-1;
	ehtrigger[ehid]=-1;
}
function preventdefault(evt){
    var e=evt?evt:window.event;
    if (e.preventDefault) e.preventDefault();
    else e.returnValue=false;
}
function stoppropagation(evt){
    var e=evt?evt:window.event;
    if (e.stopPropagation) e.stopPropagation();
    else e.cancelBubble=true;
} 





function getdate() {
	var d = new Date();
	return d.getDate();
}
function getmonth() {
	var d = new Date();
	return d.getMonth();
}
function getyear() {
	var d = new Date();
	return d.getFullYear();
}
// random no
var lastrandno = -1;
function getrandnov1(minno,maxno) {
	var thisrandno=Math.floor((maxno-(minno-1))*Math.random())+minno;
	while (thisrandno==lastrandno) thisrandno=Math.floor((maxno-(minno-1))*Math.random())+minno;
	lastrandno=thisrandno;
	return thisrandno;
}
function getrandno(minno,maxno) {
	var tempresult = 0;
	var tempcounter1 = 0;
	// prevent duplicated no and out of range
	while (tempresult == 0 || tempresult == lastrandno || tempresult < minno || tempresult > maxno) {
		tempcounter1 = Math.abs(Math.round(Math.random()*(10-1))+1);
		for (var i=0; i<tempcounter1; i++) tempresult = Math.abs(Math.round(Math.random()*(maxno-minno))+minno);
	}
	// update last generated no
	lastrandno = tempresult;
	return tempresult;
}
function iseven(no) {
	if (no%2) return false;
	else return true;
}
function isinrange(no,down,up) {
	if (no>=down&&no<=up) return true;
	else return false;
}





function fixsquote(input) {
	return input.replace(/'/g, "&prime;");
}
function fixdquote(input) {
	return input.replace(/"/g, "&quot;");
}
function fixcr(input) {
	// Converts carriage returns 
	// to <BR> for display in HTML
	var output = "";
	for (var i = 0; i < input.length; i++) {
		if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) { i++; output += "<BR>"; }
		else { output += input.charAt(i); }
	}
	return output;
}
function makemsg() {
	var ar=arguments; var entry=''; var msg=''; var compound='';
	for (var c1=0;c1<=ar.length-1;c1++) {
		entry=ar[c1].substr(0,ar[c1].indexOf('='));
		msg=ar[c1].substr(entry.length+1,ar[c1].length-entry.length-1);
		compound=compound+entry+'='+msg+entry+'EnD';
	}
	return compound;
}
//messages is combined this way:
//entry name + "=" + message text + entry name+"EnD"
//e.g. "EntrY1=msg1EntrY1EnDEntrY2=msg2EntrY2EnDEntrY3=msg3EntrY3EnD"
function extractmsg(msg,entry) {
	var startpos=0; var endpos=0;
	var startentry=entry+'=';
	var endentry=entry+'EnD';
	startpos=msg.indexOf(startentry)+startentry.length;
	endpos=msg.indexOf(endentry);
	return msg.substr(startpos,endpos-startpos);
}
function extractfileext(path) {
	return path.substring(path.lastIndexOf('.')+1,path.length);
}





var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]
};
var iever=-1;
function isie() {
	if (iever==-1) {
		BrowserDetect.init();
		iever=BrowserDetect.browser=='Explorer'?BrowserDetect.version:false;
	}
	return iever;
}
var ffver=-1;
function isff() {
	if (ffver==-1) {
		BrowserDetect.init();
		ffver=BrowserDetect.browser=='Firefox'?BrowserDetect.version:false;
	}
	return ffver;
}
var safver=-1;
function issaf() {
	if (safver==-1) {
		BrowserDetect.init();
		safver=BrowserDetect.browser=='Safari'?BrowserDetect.version:false;
	}
	return safver;
}





function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
function setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) +
		( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
		( ( path ) ? ';path=' + path : '' ) +
		( ( domain ) ? ';domain=' + domain : '' ) +
		( ( secure ) ? ';secure' : '' );
}
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';
}





function urlencode(str) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // %          note: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/
    // *     example 1: urlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin+van+Zonneveld%21'
    // *     example 2: urlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: urlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'
    var histogram = {}, histogram_r = {}, code = 0, tmp_arr = [];
    var ret = str.toString();
    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
    // The histogram is identical to the one in urldecode.
    histogram['!']   = '%21';
    histogram['%20'] = '+';
    // Begin with encodeURIComponent, which most resembles PHP's encoding functions
    ret = encodeURIComponent(ret);
    for (search in histogram) {
        replace = histogram[search];
        ret = replacer(search, replace, ret) // Custom replace. No regexing
    }
    // Uppercase for full PHP compatibility
    return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2) {
        return "%"+m2.toUpperCase();
    });
    return ret;
}
function postpage(a,t) {
	var bd=document.body;
	var d=document.createElement('div');
	d.style.visibility='hidden';
	var f=document.createElement('form');
	f.action=a; f.target=t; f.method="post";
	var ar=0; ar=arguments; var hname=''; var hval=''; var h=0;
	for (var c1=2;c1<=arguments.length-1;c1++) {
		h=document.createElement('input'); h.type='hidden';
		hname=ar[c1].substr(0,ar[c1].indexOf('='));
		hval=ar[c1].substr(hname.length+1,ar[c1].length-hname.length-1);
		h.name=hname; h.value=hval;
		f.appendChild(h);
	}
	d.appendChild(f);
	bd.appendChild(d);
	f.submit();
}
//Gets the browser specific XmlHttpRequest Object
function getajrq() {
	if (window.XMLHttpRequest) return new XMLHttpRequest(); //Not IE
	else if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); //IE
	else alert("Your browser doesn't support the XmlHttpRequest object.");
}			
var ajrq=getajrq();
function postajrq(aj,rurl,rparams,onreceive) {
	if (aj==0) aj=ajrq;
	if (!(aj.readyState==4||aj.readyState==0)) return; //If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	showld();
	aj.open("POST",rurl,true);
	//aj.open("GET","db.php?qid=news",true);
	aj.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	aj.setRequestHeader("Content-length",rparams.length);
	aj.setRequestHeader("Connection","close");
	aj.onreadystatechange=function(){ if(aj.readyState==4&&aj.status==200&&onreceive&&onreceive!=''){ onreceive(aj.responseText);hideld(); }};
	aj.send(rparams);
	//aj.send(null);
}
function postf2m(f,submitf) {
	var fieldh=0; var hiddendone=0; var h=0;
	while (!hiddendone) {
		if (f.elements.length<=0) hiddendone=1;
		for (var c1=0;c1<=f.elements.length-1;c1++) {
			fieldh=f.elements[c1];
			if (fieldh.type.toLowerCase()=='hidden'&&
				fieldh.name!='action'&&
				fieldh.name.substring(0,2)!='h_'&&
				fieldh.name.substring(0,5)!='fatt_') {
				h=document.createElement('input'); h.type='hidden'; h.name='h_'+fieldh.name; h.value=fieldh.value;
				f.removeChild(fieldh);
				f.appendChild(h);
				break;
			}
			if (c1==f.elements.length-1) hiddendone=1;
		}
	}
	var fieldatt=0; var field=0; var et='';
	var slice1=''; var slice2='';
	for (var c1=0;c1<=f.elements.length-1;c1++) {
		if (f.elements[c1].name.substring(0,5)=='fatt_') {
			fieldatt=f.elements[c1];
			eval('field=f.'+fieldatt.name.replace('fatt_','')+';');
			et=fieldatt.value.substr(fieldatt.value.indexOf('_et_')+4);
			if (fieldatt.value.search('_rf')!=-1) {
				if (field.value==null||field.value=='') { alert('Please provide : ['+et+']'); return false; }
			}
			if (fieldatt.value.search('_n')!=-1) {
				if (!isFinite(parseInt(field.value))) { alert('Must be number : ['+et+']'); return false; }
			}
			if (fieldatt.value.search('_mincl')!=-1) {
				slice1=fieldatt.value.substr(fieldatt.value.indexOf('_mincl')+6); slice2=slice1;
				if (slice1.search('_')!=-1) slice2=slice1.substr(0,slice1.indexOf('_'));
				if (field.value.length<parseInt(slice2)) { alert('Length not less than '+slice2+' : ['+et+']'); return false; }
			}
			if (fieldatt.value.search('_maxcl')!=-1) {
				slice1=fieldatt.value.substr(fieldatt.value.indexOf('_maxcl')+6); slice2=slice1;
				if (slice1.search('_')!=-1) slice2=slice1.substr(0,slice1.indexOf('_'));
				if (field.value.length>parseInt(slice2)) { alert('Length not more than '+slice2+' : ['+et+']'); return false; }
			}
			if (fieldatt.value.search('_em')!=-1) {
				if (field.value.search('@')==-1||field.value.search('.')==-1||field.value.length<5) { alert('Not an valid e-mail address : ['+et+']'); return false; }
			}
		}
	}
	if (submitf) f.submit();
	return true;
}
function dl(path) {
	postpage('php/dl.php','_self','file=../'+path);
}





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];}}
}





// SuperSleight, version 1.1.0
// version 1.1.0 by Jeffrey Barke <http://themechanism.com/> 20071218
// Essential (99% of the) code by Drew McLellan <http://24ways.org/2007/supersleight-transparent-png-in-ie6>
var supersleight = function() {
	var root = false; var applyPositioning = true; var shim = 'x.gif'; // path to a transparent GIF image
	var fnLoadPngs = function() {
		if (root) { root = document.getElementById(root); } else { root = document; } // if supersleight.limitTo called, limit to specified id
		for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
			if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) { bg_fnFixPng(obj); } // background pngs
			if (obj.tagName == 'IMG' && obj.src.match(/\.png$/i) !== null) { el_fnFixPng(obj); } // image elements
			if (applyPositioning && (obj.tagName == 'A' || obj.tagName == 'INPUT') && obj.style.position === '') { obj.style.position = 'relative'; } // apply position to 'active' elements
		}
	};
	var bg_fnFixPng = function(obj) {
		var mode = 'scale'; var bg = obj.currentStyle.backgroundImage; var src = bg.substring(5,bg.length-2);
		if (obj.currentStyle.backgroundRepeat == 'no-repeat') { mode = 'crop'; }
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
		obj.style.backgroundImage = 'url(' + shim + ')';
	};
	var el_fnFixPng = function(img) {
		var src = img.src;
		img.style.width = img.width + 'px'; img.style.height = img.height + 'px';
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
		img.src = shim;
	};
	var addLoadEvent = function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') { window.onload = func; }
		else { window.onload = function() { if (oldonload) { oldonload(); } func(); }; }
	};
	// supersleight object
	return {
		init: function(strPath, blnPos, strId) {
			if (document.getElementById) {
				if (typeof(strPath) != 'undefined' && null !== strPath) { shim = strPath; }
				if (typeof(blnPos) != 'undefined' && null !== blnPos) { applyPositioning = blnPos; }
				if (typeof(strId) != 'undefined' && null !== strId) { root = strId; }
				addLoadEvent(fnLoadPngs);
			} else { return false; }
		},
		limitTo: function(el) { root = el; },
		run: function(strPath, blnPos, strId) {
			if (document.getElementById) {
				if (typeof(strPath) != 'undefined' && null !== strPath) { shim = strPath; }
				if (typeof(blnPos) != 'undefined' && null !== blnPos) { applyPositioning = blnPos; }
				if (typeof(strId) != 'undefined' && null !== strId) { root = strId; }
				fnLoadPngs();
			} else { return false; }
		}
	};
}();
// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('top');
// optional path to a transparent GIF image, apply positioning, limitTo
/*
The init method of the supersleight object takes three optional parameters:
1. String path to the transparent gif file. Note this path is relative to the actual document, not the JavaScript document.
2. Boolean value to apply relative positioning to anchor and input elements. Pass false to leave the elements as they are.
3. String ID of an element to limit SuperSleight's operations to.
To call SuperSleight from a script, use the run method of the supersleight object. This method takes the same three optional parameters as the init method.
*/
//supersleight.init('gfx/fixie6png.gif',false);
function fixiepng(relpos,scope) {
	if (isie()) supersleight.run('gfx/fixie6png.gif',relpos,scope);
}
//var fixpaVersion = navigator.appVersion.split("MSIE");
//var fixpbversion = parseFloat(fixpaVersion[1]);
function fixiepngv1(imgid) {
	if (!isie()) return;
  //if ((fixpbversion >= 5.5) && (document.body.filters)) {
	var img=document.getElementById(imgid);
	if (img.tagName.toLowerCase()!='img') return;
	if (img.src.substring(img.src.length-3,img.src.length).toLowerCase()!="png") return;
	var cid=(img.id)?"id='"+img.id+"' ":"";
	var cclass=(img.className)?"class='"+img.className+"' ":"";
	var ctitle=(img.title)?"title='"+img.title+"' ":"title='"+img.alt+"' ";
	var cstyle=img.style.cssText+";";
	cstyle=cstyle+"display:inline-block;";
	cstyle=cstyle+"width:"+img.width+"px;";
	cstyle=cstyle+"height:"+img.height+"px;";
	if (img.align.toLowerCase()=="left") cstyle=cstyle+"float:left;";
	if (img.align.toLowerCase()=="right") cstyle=cstyle+"float:right;";
	if (img.parentElement.href) cstyle=cstyle+"cursor:hand;";
	cstyle=cstyle+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='scale');";
	var container="<span "+cid+cclass+ctitle+"style=\""+cstyle+"\"></span>";
	img.id=img.id+'pngfixed';
	img.outerHTML=container;
  //}
}
function fixiepngupdatesrcv1(cid,src) {
	var container=document.getElementById(cid);
	container.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";
}
function fixiepngallv1() {
	if (!isie()) return;
  //if ((fixpbversion >= 5.5) && (document.body.filters)) {
	for(var i=0; i<document.images.length; i++) { fixiepngv1(document.images[i].id); }
  //}
}
function fixie6bgimg() {
	if (isie()==6) { try { document.execCommand("BackgroundImageCache",false,true); } catch(e) { /* just in case this fails .. ? */ }}
}





/**
 * 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;
function setflash(divid, flashfile, flashid, flashwidth, flashheight, flashver, bgc, wmode) {
	var so = new SWFObject(flashfile, flashid, flashwidth, flashheight, flashver, bgc);
	//so.addParam('swLiveConnect', 'true');
	so.addParam("allowScriptAccess", "always");
	//so.addParam("salign", "t");            // alignment parameter
	//so.addParam("quality", "high");        // movie quality setting
	//so.addParam("scale", "noscale");       // used for full-screen movies
	//so.addParam("wmode", "transparent");   // player transparency setting
	if (wmode != "") so.addParam("wmode", wmode);
	//so.addVariable("variable1", "value1"); // pass variable to Flash movie
	//so.addVariable("variable2", "value2"); // pass variable to Flash movie
	//so.addVariable("variable1", getQueryParamValue("variable1")); // to pass "http://example.com/page.html?variable1=value1"
	var ar=0; ar=arguments; var varname=''; var val='';
	for (var c1=8;c1<=arguments.length-1;c1++) {
		varname=ar[c1].substr(0,ar[c1].indexOf('='));
		val=ar[c1].substr(varname.length+1,ar[c1].length-varname.length-1);
		so.addVariable(varname,val);
	}
	so.useExpressInstall('gfx/expressinstall.swf'); // Adobe Express Install - requires "expressinstall.swf" file
	//so.setAttribute('xiRedirectUrl', 'http://example.com/upgrade-finished.html'); // redirect after express install - must be abs url
	so.write(divid);
	delete so;
}
function getflashver() {
	var fversion = deconcept.SWFObjectUtil.getPlayerVersion();
	//if (document.getElementById && fversion["major"] > 0) document.getElementById('flashversion').innerHTML = "You have Flash player "+ fversion['major'] +"."+ fversion['minor'] +"."+ fversion['rev'] +" installed.";
	if (fversion["major"]>0) return "You have Flash player "+ fversion['major'] +"."+ fversion['minor'] +"."+ fversion['rev'] +" installed.";
}
function getflashobj(embedname){
	if (window.document[embedname]) return window.document[embedname];
	if (navigator.appName.indexOf("Microsoft Internet")==-1) {if (document.embeds&&document.embeds[embedname]) return document.embeds[embedname];}
	else return document.getElementById(embedname);
}
function getflashw(embedname) {
	var movieobj=getflashobj(embedname);
	return parseInt(movieobj.TGetProperty("/",8));
}
function getflashh(embedname) {
	var movieobj=getflashobj(embedname);
	return parseInt(movieobj.TGetProperty("/",9));
}




