function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
	return true;
	}
	else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else{
   		return false;
 	}
}

(function(){
 /*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand;
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
	}
	catch(oh){};
})();

function jsemail(email) {
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
}

function jsemaillink(email, link, classname) {
	document.write('<a href="'+link+'"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('</a>');
}

function jsmailto(emailto, email, classname) {
	document.write('<a href="');
	for(i=emailto.length-1; i>=0; i--)
		document.write(emailto.charAt(i));
	document.write('"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('</a>');
}

function jsmailtolink(email, cim, classname) {
	document.write('<a href="');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>'+cim+'</a>');
}

function chr(c) {
	var h = c.toString(16);
	if (h.length==1)
		h = '0'+h;
	h = unescape('%'+h);
	return h;
}

function overflowautoinit(){
	var tags=document.getElementsByTagName("div");
	for (i=0; i<tags.length; i++) {
		tag=tags[i];
		if(tag.className=="overflowautox") {
			tag.style.height=(tag.offsetHeight+tag.offsetHeight-tag.clientHeight)+'px';
		} else if (tag.className=="overflowautoy") {
			tag.style.width=(tag.offsetWidth+tag.offsetWidth-tag.clientWidth)+'px';
		}
	}
}
addEvent(window, 'load', overflowautoinit);

