Xoffset=15;
Yoffset=15;

var old,skn,skn_img,iex=(document.all),yyy=-1000;
var mouseX;var mouseY; 

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all

if (ns4) { skn=document.dek; skn_img=document.dek_img;}
else if (ns6) { skn=document.getElementById("dek").style; skn_img=document.getElementById("dek_img").style; }
else if (ie4) { skn=document.all.dek.style; skn_img=document.all.dek_img.style;}

if(ns4) document.captureEvents(Event.MOUSEMOVE);
else {

	skn.visibility="visible"
	skn.display="none"

	skn_img.visibility="visible"
	skn_img.display="none"
}

document.onmousemove=get_mouse;

function popup(msg){
	var content="<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 "+
	"BGCOLOR=#777777><TD bgcolor=#c8e8fe><FONT COLOR=black SIZE=1 face=\"Verdana, Arial, Helvetica, sans-serif\">"+msg+"</FONT></TD></TABLE>";
	yyy=Yoffset;
	if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
	if(ns6){document.getElementById("dek").innerHTML=content;skn.display=""}
	if(ie4){document.all("dek").innerHTML=content;skn.display=""}
}

function popup_image(img){
	var myImage = new Image();
	myImage.src = img;
	w=myImage.width;
	h=myImage.height;
	skn_img.left=mouseX;
	skn_img.top=mouseY;

	var content='<table cellpadding=2 cellspacing=2 bgcolor="#ffffff" style="border: 1px solid #777777;"><tr><td align=right bgcolor="#eeeeee"><b><a href="javascript: kill_img()">X</a></b></td></tr><tr><td><img src="'+img+'" border=0></td></tr></table>';
	if(ns4){skn_img.document.write(content);skn_img.document.close();skn_img.visibility="visible"}
	if(ns6){document.getElementById("dek_img").innerHTML=content;skn_img.display=""}
	if(ie4){document.all("dek_img").innerHTML=content;skn_img.display=""}

}

function getScrollPosition() {
	if (document.documentElement && document.documentElement.scrollTop)
		return document.documentElement.scrollTop; // IE6 +4.01
	if (document.body && document.body.scrollTop)
		return document.body.scrollTop; // IE5 or DTD 3.2
	return 0;
}

function get_mouse(e){
	var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
	skn.left=(x+Xoffset)+"px";
	mouseX = (x+Xoffset)+"px";
	var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
	skn.top=(y+yyy)+"px";
	mouseY=y+"px";
}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}

function kill_img(){
yyy=-1000;
if(ns4){skn_img.visibility="hidden";}
else if (ns6||ie4) skn_img.display="none"
}

function n_window(theurl,w,h)
{
 // set the width and height
 var the_width=w;
 var the_height=h;
 // set window position
 var from_top=200;
 var from_left=200;
 // set other attributes
 var has_toolbar='no';
 var has_location='no';
 var has_directories='no';
 var has_status='no';
 var has_menubar='no';
 var has_scrollbars='yes';
 var is_resizable='yes';
 // attributes put together
 var the_atts='width='+the_width+'show,height='+the_height+',top='+from_top+',screenY='+from_top+',left='+from_left+',screenX='+from_left;
 the_atts+=',toolbar='+has_toolbar+',location='+has_location+',directories='+has_directories+',status='+has_status;
 the_atts+=',menubar='+has_menubar+',scrollbars='+has_scrollbars+',resizable='+is_resizable;
 // open window
 window.open(theurl,'',the_atts);
}

function myConfirm(msg)
{
    if ( ! window.showModalDialog || window.external.IYBrowserExtend) {
    if(!confirm(msg)) return false;
    } else {
    var oArguments = {
	Message : msg
    };
    var oAction = window.showModalDialog("confirmation.html",oArguments,"dialogHeight:150px;dialogWidth:300px;status:no;help:no;resizable:yes;scroll:no;");
			
    if(oAction)
    {
    if(!oAction.confirmed) return false;
    }
} 
    return true;
}

function doSel(obj)
{
     for (i = 0; i < obj.length; i++)
        if (obj[i].selected == true)
           eval(obj[i].value);
}

function getxmlhttp() {

var xmlhttp=false;
try {
	// if Javascript version>5
	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	//if not use the older ActiveX object
	try {
	//if using IE
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	xmlhttp=false;
	}
}
// if not using IE, create a javascript instance of the object
if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp=new XMLHttpRequest();
}

return xmlhttp;

}

function CountTitleLeft(field, max) {
	if (field.value.length > max)
		field.value = field.value.substring(0, max);
}
