<!--//
// IS IE
is_ie = false;
if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)){
	is_ie = true;
}
// TEXTAREA COPY ALL, DELETE ALL, PRINT, REVERT
var copytoclip=1
function selectAll(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	if (document.all&&copytoclip==1){
		therange=tempval.createTextRange()
		therange.execCommand("Copy")
		window.status="The contents have been selected and copied!"
		setTimeout("window.status=''",2800)
	}
}
function deleteAll(theField) {
	var tempval = eval("document."+ theField);
	tempval.value = '';
}
function printText(theField){
	if (window.print) {
		text = eval("document." + theField + ".value");
		winId = window.open('','newwin',"height=500,width=700,status=yes,toolbar=no,menubar=no,location=no");
		with (winId.document) {
		write('<html><head><title>Print Window<\/title><\/head><body bgcolor="#FFFFFF" onLoad="window.focus(); window.print(); window.close();"><xmp style="word-wrap: break-word">' + text + '<\/xmp><\/body><\/html>');
		close();
		}
	}
}
function revert(){
	document.location.href = document.location.href;
}
// COOKIES
function getExpire(year){
     var expire = new Date ();
     expire.setTime (expire.getTime() + ((year *365) *24 * 60 * 60 * 1000));
     expire = expire.toGMTString();
     return expire;
}
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
	  ((expires) ? "; expires=" + getExpire(expires) : "") +
	  ((path) ? "; path=" + path : "") +
	  ((domain) ? "; domain=" + domain : "") +
	  ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
	begin = dc.indexOf(prefix);
	if (begin != 0) return null;
  } else
	begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
	end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
// REFRESH PARENT
function refreshParent(){
	window.opener.location.href = window.opener.location.href;
}
// VISIT & GO
function visit(url){
	document.location.href = url;
}
function go(path){
	document.location.href = path;
}
// WINDOW STATUS
function setStatus(value) {
	window.status = value;
}
// IMAGE POSITION
var tempEl;
function getRealLeft(imgElem){
	if(ns4){
		xPos=imgElem.x;
	}else if(!exclude){
		xPos=eval(imgElem).offsetLeft;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			xPos+=tempEl.offsetLeft;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		xPos+=parseInt(document.body.leftMargin);
	}
	return xPos;
}
function getRealTop(imgElem){
	if(ns4){
		yPos=imgElem.y;
	}else if(!exclude){
		yPos=eval(imgElem).offsetTop;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			yPos+=tempEl.offsetTop;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		yPos+=parseInt(document.body.topMargin);
	}
	return yPos;
}
// CMC
function preparePrint(){
	var url = document.location.href;
	if(url.indexOf('?') >= 0){
		if(url.indexOf('&print=') >= 0){
			document.location.href = document.location.href;
		}else{
			document.location.href = document.location.href + "&print=1";
		}		
	}else{
		document.location.href = document.location.href + "?print=1";
	}
}
//-->