//@charset "UTF-8"à;

var SVGNS="http://www.w3.org/2000/svg"
var XLINKNS="http://www.w3.org/1999/xlink"
var XHTMLNS="http://www.w3.org/1999/xhtml"

function XOR(a,b) {
  return ( a || b ) && !( a && b );
}

function isTrue(value){
	if (value == null) return false;
	if (parseFloat(value) == 0.0) return false;
	if (value.toString().toLowerCase() == 'false') return false;
	
	if (value) return true;
	return false;
}

function isset(varName){
	eval('var out = typeof '+varName+' != "undefined"');
	return out
}

var timeoutObjs = Array()
function TimedRun (func,time){
	this.execFunction = func;
	this.time = time;
	
	this.run = TimedRun__run;
	this.cancel = TimedRun__cancel;	
}
function TimedRun__run (){
	this.id = timeoutObjs.length;
	eval('var runFunc = function(){ timeoutObjs['+id+'].execFunction(); timeoutObjs['+id+']=undefined;}');
	timeoutObjs[this.id] = {execFunction:runfunc,id:setTimeout(runFunc,this.time)}
}
function TimedRun__cancel(){
	clearTimeout(timeoutObjs[this.id].id);
	timeoutObjs[this.id]=undefined;
	this.id = undefined;
}

var threadObjs = Array()
function Thread (func,time){
	this.execFunction = func;
	this.time = time;
	this.run = Thread__run;
	this.cancel = Thread__cancel;	
}
function Thread__run (){
	this.id = threadObjs.length;
	eval('var runFunc = function(){ threadObjs['+this.id+'].obj.execFunction();}');
	threadObjs[this.id] = {obj:this,id:setInterval(runFunc,this.time)}
}
function Thread__cancel(){
	clearInterval(threadObjs[this.id].id);
	threadObjs[this.id]=undefined;
	this.id = undefined;
}

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 = "";
	window.parent.document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = window.parent.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 versioncmp(ver1,ver2){
	var reg = new RegExp('[0-9]+');
	ver1 = ver1.toString();
	ver2 = ver2.toString();
	
	while (true){
		ver1 = reg.exec(ver1);
		ver2 = reg.exec(ver2);
		
		if (ver1 == null && ver2 == null) return 0;
		if (ver2 == null) return 1;
		if (ver1 == null) return -1;
		var v1 = parseInt(ver1[0],10);
		var v2 = parseInt(ver2[0],10);
		if (v1 > v2) return 1;
		if (v1 < v2) return -1;
		
		ver1 = ver1.input.substring(ver1.index +ver1[0].length);
		ver2 = ver2.input.substring(ver2.index +ver2[0].length);
	}
}

