var alp=0;
var coltim=null;
var desiredDarkness=80;
var faderSteps=5;
var screenW = screen.width, screenH = screen.height;
var browser=navigator.appCodeName;
var fullbrowser=navigator.appName;
var b_version=navigator.appVersion+"("+navigator.appMinorVersion+")";
var os=navigator.platform;
var version=parseFloat(b_version);
var previousPage=document.referrer;
var isIE=(fullbrowser=="Microsoft Internet Explorer");
function showOverlay(srcObj,show) {
	tar=ob(srcObj.id.replace("block","overlay"));
	if (show) {
		revealObject(tar);
	}else{
		hideObjectDelay(tar);
	}
}
var revealObjects=new Array();
var revealTimer=null;
var hideTimer={};
function revealObject(tar) {
	id=tar.id.replace("block","");
	if (hideTimer[id]) clearTimeout(hideTimer[id]);
	resizeObject(tar,false,true,0,0,null,null,null,20,4,true,null,false);
}
function hideObjectDelay(tar) {
	id=tar.id.replace("block","");
	if (hideTimer[id]) clearTimeout(hideTimer[id]);
	hideTimer[id]=setTimeout("hideObject('"+tar.id+"')",500);
}
function hideObject(tar) {
	if (typeof(tar)=="string") tar=ob(tar);
	resizeObject(tar,false,true,null,null,null,0,null,20,4,false,null,false);
}
function fadeObjectByClass(cls,alpha) {
	dvs=document.getElementsByTagName("DIV");
	for(i=0;i<dvs.length;i++) {
		if (dvs[i].className==cls) fader(dvs[i],alpha);	
	}
}
var resizingObjects=new Array();
var resizingTimer=null;
function removeFromResize(obj) {
	index=resizeObjIndex(obj);
	if (index>=0) {
		resizingObjects.splice(index,1);
	}
}
function resizeObject(obj,stretchX,stretchY,fromX,fromY,toX,toY,centeredObj,maxStep,division,ifnone,handler,removeDims) {
	index=resizeObjIndex(obj);
	ok=true;
	if (ifnone) ok=(obj.style.display=="none");
	
	if (ok){
		if (toX===null && toY===null) {
			dims=objFreeSize(obj,stretchX,stretchY);
			if (stretchX) toX=dims[0];
			if (stretchY) toY=dims[1];
			
		}
		if (fromX===null && fromY===null) {
			if (obj.style.display=="none") {
				dims=[0,0];
			}else{
				dims=objFreeSize(obj,stretchX,stretchY);
			}
			if (stretchX) fromX=dims[0];
			if (stretchY) fromY=dims[1];
		}
		if (index>=0) {
			if (resizingObjects[index]["toX"]!=toX && resizingObjects[index]["toY"]!=toY) {
				resizingObjects[index]["toX"]=toX;
				resizingObjects[index]["toY"]=toY;
				resizingObjects[index]["elasticX"]=stretchX;
				resizingObjects[index]["elasticY"]=stretchY;
			}else{
				index=-1;
			}
		}
		if (index<0) {
		//alert(toY+'!='+fromY+' || '+toX+'!='+fromX);
			if (toY!=fromY || toX!=fromX) {
				resizingObjects.push({"sizeObj":obj,"elasticX":stretchX,"elasticY":stretchY,"toX":toX,"toY":toY,"currentX":fromX,"currentY":fromY,"maxStep":maxStep,"division":division,"centeredContainer":centeredObj,"handler":handler,"removeDims":removeDims});
				os=obj.style;
				if (stretchX) os.width=fromX+"px";
				if (stretchY) os.height=fromY+"px";
				os.overflow="hidden";
				os.display="block";
			}
		}
		if (resizingTimer===null) resizingTimer=setTimeout("resizeProcess()",2);
	}
}
function resizeObjIndex(obj) {
	index=-1;
	for(i=0;i<resizingObjects.length;i++) {
		if (resizingObjects[i]["sizeObj"]==obj) index=i;
	}
	return index;
}
function resizeProcess() {
	if (resizingObjects.length>0) {
		for(i=resizingObjects.length-1;i>=0;i--) {
			o=resizingObjects[i];
			fin=true;
			if (o["elasticX"]) {
				cx=(o["toX"]-o["currentX"])/o["division"];
				if (cx<-o["maxStep"]) cx=-o["maxStep"];
				if (cx>o["maxStep"]) cx=o["maxStep"];
				if (cx>=-1 && cx<=1) {
					cx=o["toX"];
				}else{
					fin=false;
					cx+=o["currentX"];
				}
				resizingObjects[i]["currentX"]=cx;
				o["sizeObj"].style.width=cx+"px";
			}
			if (o["elasticY"]) {
				cy=(o["toY"]-o["currentY"])/o["division"];
				if (cy<-o["maxStep"]) cy=-o["maxStep"];
				if (cy>o["maxStep"]) cy=o["maxStep"];
				if (cy>=-1 && cy<=1) {
					cy=o["toY"];
				}else{
					fin=false;
					cy+=o["currentY"];
				}
				resizingObjects[i]["currentY"]=cy;
				o["sizeObj"].style.height=cy+"px";
			}
			if (o["centeredContainer"]) {
				cO(o["centeredContainer"]);
			}
			if (fin) {
				if (o["removeDims"]) o["sizeObj"].style.width=o["sizeObj"].style.height='';
				o["sizeObj"].style.overflow="";
				if (o["toX"]==0 || o["toY"]==0) o["sizeObj"].style.display="none";
				if (o["handler"]) o["handler"]();
				resizingObjects.splice(i,1);
			}
		}
		if (resizingObjects.length>0) {
			resizingTimer=setTimeout("resizeProcess()",2);
		}else{
			resizingTimer=null;
		}
	}else{
		resizingTimer=null;
	}
}
function objFreeSize(obj,stretchX,stretchY) {
	if (obj.style.display=="none") {
		if (stretchY) fh=obj.style.height;
		if (stretchX) fw=obj.style.width;
		pos=obj.style.position;
		if (!isIE) obj.style.position="absolute"
		obj.style.visibility="hidden";
		obj.style.display="block";
		if (stretchY) obj.style.height="";
		if (stretchX) obj.style.width="";
		w=obj.offsetWidth;
		h=obj.offsetHeight;
		if (stretchY) obj.style.height=fh;
		if (stretchX) obj.style.width=fw;
		obj.style.display="none";
		obj.style.visibility="visible";
		if (!isIE) obj.style.position=pos;
	}else{
		w=obj.offsetWidth;
		h=obj.offsetHeight;
	}
	return [w,h];
}
function ob(id) {return document.getElementById(id);}
function drawBlack(){
    pRH("<div id=\"blackBox\" style=\"visibility:hidden;position:fixed;z-index:3;padding:0px;margin:0px;top:0px;left:0px;width:100%;height:100%\" >&nbsp;</div>",document.body);
    sizeFader();
}
function sizeFader() {
    if (ob("blackBox")!=null)     {
        var docHeight=(typeof document.height != 'undefined')?document.height:(document.compatMode && document.compatMode != 'BackCompat')?document.documentElement.scrollHeight:document.body.scrollHeight;
        var wh=getWindowHeight();
        if (docHeight<wh) docHeight=wh;
        obj=ob("blackBox");
        obj.style.height=docHeight+"px";
    }
    if (ob("dialogBox")!=null) centerObject(ob("dialogBox"));
}
function fader(obj,o) {if (obj.style) {if (o==100) {if (obj.style.MozOpacity!=null){obj.style.MozOpacity = "";}else if (obj.style.opacity!=null){obj.style.opacity = "";}else if (obj.style.filter!=null){obj.style.filter = "";}}else{if (obj.style.MozOpacity!=null){obj.style.MozOpacity = (o/100) - .001;}else if (obj.style.opacity!=null){obj.style.opacity = (o/100) - .001;}else if (obj.style.filter!=null){obj.style.filter = "alpha(opacity="+o+")";}}}}

function startFadeUp() {
    window.onresize=sizeFader;
    window.onscroll=sizeFader;
    if (ob("blackBox")==null) drawBlack();
    obj=ob("blackBox");
	fadeObject(obj,0,desiredDarkness,faderSteps,null);
}
function backgroundGone() {
	removeTheNode("blackBox");
	window.onresize=null;
	window.onscroll=null;
}
function startFadeDown() {
    if (ob("blackBox")!=null) fadeObject(ob("blackBox"),desiredDarkness,0,faderSteps,backgroundGone);
}
function getWindowHeight() {
    dims=windowDims();
	return dims[1];
} 
function getWindowWidth() {
    dims=windowDims();
	return dims[0];
} 
function windowDims() {
    var myWidth=myHeight=0;
    if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
    return [myWidth,myHeight];
}
function getScrollXY() {
    var scrOfX=scrOfY=0;
	if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
    return [scrOfX,scrOfY];
}
function startFadeIn(srcObj){
    fader(srcObj,0);
	srcObj.style.visibility="visible";
	fadeObject(obj,0,100,5,null);
}
function startFadeOut(srcObj){
	idx=-1;
	for(i=0;i<fadingObjects.length;i++) {
		if (fadingObjects[i]['object']==srcObj) idx=i;
	}
	if (idx>=0) {
		fadeObject[idx]['to']=0;
	}else{
		fadeObject(obj,100,0,5,null);
	}
}
var fadingObjects=new Array();
var fadeobjectinterval=2;
var faderTimer=null;
function fadeObject(obj,from,to,steps,handler) {
	existed=false;
	for(o=0;o<fadingObjects.length;o++) {
		if (fadingObjects[o]['object']==obj) {
			fadingObjects[o]={'object':obj,'from':fadingObjects[o]["alpha"],'to':to,'steps':steps,'handler':handler,'alpha':fadingObjects[o]["alpha"]};
			existed=true;
		}
	}
	if (!existed) fadingObjects.push({'object':obj,'from':from,'to':to,'steps':steps,'handler':handler,'alpha':from});
	if (fadingObjects.length>0 && faderTimer==null) faderTimer=setTimeout("fadeObjects()",fadeobjectinterval);
}
function fadeObjects() {
	toremove=new Array();
	for(o=0;o<fadingObjects.length;o++) {
		obj=fadingObjects[o];
		step=obj["steps"];
		if (obj["from"]>obj["to"]) step=-step;
		obj['alpha']+=step;
		if (obj["alpha"]>=obj["to"] && step>0) {
			obj['alpha']=obj['to'];
			toremove.push(o);
		}else if(obj["alpha"]<=obj["to"] && step<0) {
			obj['alpha']=obj['to'];
			toremove.push(o);
		}
		fader(obj["object"],obj["alpha"]);
		if (obj['object'].style.visibility=='hidden') obj['object'].style.visibility="visible";
	}
	toremove.reverse();
	for(r=0;r<toremove.length;r++) {
		if (fadingObjects[toremove[r]]['handler']!=null) fadingObjects[toremove[r]]['handler']();
		fadingObjects.splice(toremove[r],1);
	}
	if (fadingObjects.length>0) {
		faderTimer=setTimeout("fadeObjects()",fadeobjectinterval);
	}else{
		clearTimeout(faderTimer);
		faderTimer=null;
	}
}
function tE(srcObj, expW, expH, collapseOthers) {
	if (typeof(srcObj)=="string") srcObj=ob(srcObj);
	if (srcObj.style.display=="none") {
		dims=objFreeSize(srcObj,expW,expH);
		st=maxExpandStep(0,(expW?dims[0]:0),0,(expH?dims[1]:null),true);
		resizeObject(srcObj,expW,expH,0,0,(expW?dims[0]:null),(expH?dims[1]:null),null,st,4,false,null,true);
		if (collapseOthers.match(/\:/)) {
			o=collapseOthers.split(":");
			for(i=0;i<o.length;i++) {
				if (o[i]!='') {
					ot=ob(o[i]);
					st=maxExpandStep(ot.offsetWidth,0,ot.offsetHeight,0,false);
					if (ot.style.display=="block") resizeObject(ot,expW,expH,ot.offsetWidth,ot.offsetHeight,(expW?0:null),(expH?0:null),null,st,2,false,null,false);
				}
			}
		}else{
			ot=ob(collapseOthers);
			st=maxExpandStep(ot.offsetWidth,0,ot.offsetHeight,0,false);
			if (ot.style.display=="block") resizeObject(ot,expW,expH,ot.offsetWidth,ot.offsetHeight,(expW?0:null),(expH?0:null),null,st,2,false,null,false);
		}
	}else{
		st=maxExpandStep(srcObj.offsetWidth,0,srcObj.offsetHeight,0,false);
		resizeObject(srcObj,expW,expH,srcObj.offsetWidth,srcObj.offsetHeight,(expW?0:null),(expH?0:null),null,st,4,false,null,false);
	}
}
function maxExpandStep(fromx,tox,fromy,toy,quick) {
	dx=fromx-tox;
	dx=Math.sqrt(Math.pow(dx,2));
	dx/=(quick?5:10);
	dy=fromy-toy;
	dy=Math.sqrt(Math.pow(dy,2));
	dy/=(quick?5:10);
	if (dy>0 && dy<dx) dx=dy;
	return dx;
}
var scrolling=null;
function scrollToElement(id) {
	var scrollloc=getTop(ob(id));
    if (scrolling==null) scrolling=new Array(scrollloc,setTimeout("smoothScroll()",2));
}
function smoothScroll() {
	maxScroll=20;
	if (scrolling!=null) {
		scrolls=getScrollXY();
		ds=(scrolling[0]-scrolls[1])/3;
		if (ds<-maxScroll) ds=-maxScroll;
		if (ds>maxScroll) ds=maxScroll;
		window.scrollTo(scrolls[0],scrolls[1]+ds);
		if (getScrollXY()[1]==scrolls[1]) ds=0;
		if (ds<-1 || ds>1) {
			scrolling[1]=setTimeout("smoothScroll()",2);
		}else{
			scrolling=null;
		}
	}
}

function JSONscriptRequest(fullUrl) {
    this.fullUrl = fullUrl; 
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    this.headLoc = document.getElementsByTagName("head").item(0);
    this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
}
JSONscriptRequest.scriptCounter = 1;
JSONscriptRequest.prototype.buildScriptTag = function () {
    this.scriptObj = document.createElement("script");
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("charset", "utf-8");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}
JSONscriptRequest.prototype.removeScriptTag = function () {
    this.headLoc.removeChild(this.scriptObj);  
}
JSONscriptRequest.prototype.addScriptTag = function () {
    this.headLoc.appendChild(this.scriptObj);
}
currentRequests=new Array();
currentHandlers=new Array();

function sendRequest(docUrl,returnHandler) {
    now=new Date();
    docUrl+="&rand="+now.valueOf();
    if (window.XMLHttpRequest){
        thisRequest=new XMLHttpRequest();
        currentHandlers.push(returnHandler);
        thisRequest.onreadystatechange=requestReceived;
        thisRequest.open("GET",docUrl,true);
        thisRequest.send(null);
        currentRequests.push(thisRequest);
    }else if (window.ActiveXObject){
        thisRequest=new ActiveXObject("Microsoft.XMLHTTP");
        currentRequests.push(thisRequest);
        currentHandlers.push(returnHandler);
        if (thisRequest){
            thisRequest.onreadystatechange=requestReceived;
            thisRequest.open("GET",docUrl,true);
            thisRequest.send();
        }
    }
}
function sPR(docUrl,parameters,returnHandler) {
    now=new Date();
    docUrl+="?rand="+now.valueOf();
    if (window.XMLHttpRequest){
        thisRequest=new XMLHttpRequest();
        currentHandlers.push(returnHandler);
        thisRequest.onreadystatechange=requestReceived;
        thisRequest.open("POST",docUrl,true);
		thisRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
        currentRequests.push(thisRequest);
        thisRequest.send(parameters);
    }else if (window.ActiveXObject){
        thisRequest=new ActiveXObject("Microsoft.XMLHTTP");
        currentRequests.push(thisRequest);
        currentHandlers.push(returnHandler);
        if (thisRequest){
            thisRequest.onreadystatechange=requestReceived;
            thisRequest.open("POST",docUrl,true);
			thisRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			//thisRequest.setRequestHeader("Content-Length",parameters.length);
            thisRequest.send(parameters);
        }
    }
}
function sendForm(srcObj,forms,params,url,returnHandler) {
	//alert(ob(forms[0]).files[0]);
	thefile=ob(forms[0]).files[0];
	showLoading(srcObj,"Uploading...");
//	var formData = new FormData();
//	for(pk in params) {
//		formData.append(pk,params[pk]);
//	}
//	for(i=0;i<forms.length;i++) {
//		params["file"+i]=ob(forms[i]).files[0];
//	}
	
	sPR(url,thefile,returnHandler)
}
function requestReceived() {
    reply="";
    for (requestIndex=currentRequests.length-1;requestIndex>=0;requestIndex--) {
        if (currentRequests[requestIndex].readyState==4) {
            reply=currentRequests[requestIndex].responseText;
			currentRequests[requestIndex].getAllResponseHeaders()
            if (currentRequests[requestIndex].status==200) {
                reply=currentRequests[requestIndex].responseText;
            }
            currentRequests[requestIndex]=null;
            currentRequests.splice(requestIndex,1);
            thisHandler=currentHandlers[requestIndex];
            currentHandlers.splice(requestIndex,1);
            thisHandler(reply);
        }
    }
}
function eventLocation(e) {
	if (draggingObject) {
		ws=(draggingObject.style.position!="fixed");
	}else{
		ws=true;
	}
	if (window.event) {
		x = window.event.clientX + (ws?document.documentElement.scrollLeft + document.body.scrollLeft:0);
		y = window.event.clientY + (ws?document.documentElement.scrollTop + document.body.scrollTop:0);
	}else{
		x = e.clientX + (ws?window.scrollX:0);
		y = e.clientY + (ws?window.scrollY:0);
	}
	return [x,y];
}
function pRH(theHTML,destinationObj) {
    var hiddenArea=null;
    if (ob("ParseArea")==null) {
        hiddenArea=document.createElement("div");
        hiddenArea.style.display="none";
        hiddenArea.ID="ParseArea";
    } else {
        hiddenArea = ob("ParseArea");
    }
    hiddenArea.innerHTML=theHTML;
    for (c=0;c<hiddenArea.childNodes.length;c++) destinationObj.appendChild(hiddenArea.childNodes[c]);
    hiddenArea.innerHTML="";
}
function theSrcElement(e) {
    if (!e) var e = window.event;
    if (e.target) target = e.target
    else if (e.srcElement) target = e.srcElement
	alert(target.id);
    return target;
}
function cO(obj) {
    scr=getScrollXY();
	if (obj.style.position=="fixed") scr=[0,0];
    wh = getWindowHeight();
    t=(obj.clientHeight>wh)?scr[1]:((wh-obj.clientHeight)/2)+scr[1];
    if (t<10) t=10;
    l=((document.body.offsetWidth-obj.clientWidth)/2);
    if (l<0) l=0;
    obj.style.left=l+"px";
    obj.style.top=t+"px";
}
function sIH(obj,content) {
	thisresize=((typeof(obj)=="string")?ob(obj):obj);
    if (thisresize.tagName=="DIV" || thisresize.tagName=="TD") {
		if (obj.style) {
			if (obj.style.display=="none") {
				obj.style.display="block";
				oh=1;
			}else{
				oh=thisresize.clientHeight*1;
			}
		}else{
			oh=thisresize.clientHeight*1;
		}
        thisresize.innerHTML="<div id='parsesIH' style='width:"+obj.clientWidth+"px;position:absolute;visibility:hidden'>"+content+"</div>";
		dh=ob("parsesIH").clientHeight;
        thisresize.style.overflow="hidden";
        thisresize.style.display="block";
		thisresize.innerHTML=content;
		resizeObject(thisresize,0,1,null,oh,null,dh,null,20,2,false,null,true);
    }else{
        thisresize.innerHTML=content;
    }
}
function sIHCentered(obj,content,container) {
    thisresize=ob(obj);
    if (thisresize.tagName=="DIV" || thisresize.tagName=="TD") {
		oh=thisresize.clientHeight*1;
		ow=thisresize.clientWidth*1;
        thisresize.innerHTML="<div id='parsesIHC' style='position:absolute;visibility:hidden'>"+content+"</div>";
		dh=ob("parsesIHC").clientHeight;
		dw=ob("parsesIHC").clientWidth;
        thisresize.style.overflow="hidden";
        thisresize.style.display="block";
        thisresize.innerHTML=content;
		resizeObject(thisresize,1,1,ow,oh,dw,dh,ob(container),20,3,false,null,true);
    }else{
        thisresize.innerHTML=content;
    }
}
function getCookieValue(name) {
    reply="";
    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 (indexIn(c,nameEQ) == 0) reply=c.substring(nameEQ.length,c.length);
	}
	return reply;
}
 function getFlashMovie(movieName) {
  var isIE = indexIn(navigator.appName,"Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
 }
function rSC(reply) {
	if (reply!="ok" && reply!="") {
		sect=reply.split("<sections>");
		for(si=0;si<sect.length;si++) {
			ss=/^<scripting>/;
			if (ss.test(sect[si])) {
				eval(sect[si].replace('<scripting>',''));
			}else{
				ins=/<inside>/;
				if (ins.test(sect[si])) {
					ip=sect[si].split("<inside>");
					ob(ip[0]).innerHTML=ip[1];
				}else{
					ins=/<insert>/;
					if (ins.test(sect[si])) {
						ip=sect[si].split("<insert>");
						ats=/^<appendtostart>/;
						cont=null;
						if (ats.test(ip[0])) {
							ip[0]=ip[0].replace('<appendtostart>','');
							if (cont=ob(ip[0])) ip[1]+=cont.innerHTML;
						}
						ats=/^<appendtoend>/;
						cont=null;
						if (ats.test(ip[0])) {
							ip[0]=ip[0].replace('<appendtoend>','');
							if (cont=ob(ip[0])) ip[1]=cont.innerHTML+ip[1];
						}
						if (cont==null) cont=ob(ip[0]);
						if (cont!=null) {
							if (ip[0]=="dialog") {
								sIHCentered(ip[0],ip[1],ip[0]);
							}else{
								sIH(cont,ip[1]);
							}
						}
					}else{
						rep=/<replace>/;
						if (rep.test(sect[si])) {
							ip=sect[si].split("<replace>");
							if (src=ob("block"+ip[0])) {
								pRH("<div id=\"tempcontainer\" style=\"display:none\">"+ip[1]+"</div>",document.body);
								newsrc=ob("tempcontainer").childNodes[0];
								src.parentNode.insertBefore(newsrc,src);
								removeTheNode(src);
								removeTheNode("tempcontainer");
							}
						}else{
							alert(reply);
						}
					}
				}
			}
		}
	}
}
function focusID(id) {
	setTimeout(function(){if (ob(id)) ob(id).select();},1000);
}
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
function Delete_Cookie( name, path, domain ) {
document.cookie = name + "=" +( ( path ) ? ";path=" + path : "") +( ( domain ) ? ";domain=" + domain : "" ) +";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function rgbStringToHex(rgb) {
	rgbv=rgb.replace("rgb(","").replace(")","").replace(/ /g,"").split(",");
	r=rgbv[0]*1;
	g=rgbv[1]*1;
	b=rgbv[2]*1;
	rr=r.toString(16);
	if (rr.length==1) rr="0"+rr;
	gg=g.toString(16);
	if (gg.length==1) gg="0"+gg;
	bb=b.toString(16);
	if (bb.length==1) bb="0"+bb;
	c=rr+gg+bb;
	return c;
}
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
function trim( value ) {
	return LTrim(RTrim(value));
}
function wc() {
	return window.confirm("Are you sure?");
}
function removeTheNode(idname) {
	if (typeof(idname)=="string") {
		if (ob(idname)!=null) {
			thisNode=ob(idname);
			thisNode.parentNode.removeChild(thisNode);
		}
	}else{
		idname.parentNode.removeChild(idname);
	}
    sizeFader();
}
function handleError (err, url, line) {
	msg=err+" in line "+line+" from "+url;
	dropThisMessage(msg);
	return true;
}
function indexIn(arr,obj) {
	ind=-1;
	for(ai=0;ai<arr.length;ai++) {
		if (arr[ai]==obj) {
			ind=ai;
			break;
		}
	}
	return ind;
}
//window.defaultOnError = window.onerror; // store default handler
//window.onerror = handleError;