function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function GoVerify(p_url)
{
    if (confirm("Are You Sure?") == true) {
	    window.location = p_url;
	}
}
function GoDirect(p_url)
{
    window.location = p_url;
}
function GoClose(p_url)
{
    window.opener.location = p_url;
	window.close();
}
function Dialog(p_url,p_width,p_height,p_name,x_start,y_start,p_scroll)
{
	if (Dialog.arguments.length < 2) {
	    p_width = 500;
		p_height = 400;
	}

	if (Dialog.arguments.length < 4) {
		p_name = "dialog";
	}
	if (Dialog.arguments.length < 6) {
		x_start = 200;
		y_start = 200;
	}
	if (Dialog.arguments.length < 7) {
		p_scroll = "no";
	}	
}	

function HideDialog(p_url)
{
	newwin = window.open(p_url,null, "channelmode=no,dependent=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=10,height=10,screenX=0,left=0,screenY=0,top=0"); 
	if (newwin.focus) newwin.focus();
	if (!newwin.opener) {
		newwin.opener = self;
	}
}

function wclose() {
self.close();
}

function closeform() {
opener.document.Form1.submit();
window.close();
}

function Popup(p_url,p_width,p_height,p_scroll,p_name) {	
	var ScrWidth = screen.width;
	var ScrHeight = screen.height;
	var x = ((ScrWidth - p_width)/2);
	var y = ((ScrHeight - p_height)/2);
	if (Popup.arguments.length < 5) {
		p_name = "name"+x;
	}
	if (Popup.arguments.length < 4) {
		p_scroll = "no";
	}
	 
	newwin = window.open(p_url,p_name, "channelmode=no,dependent=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars="+p_scroll+",status=no,toolbar=no,width="+p_width+",height="+p_height+",screenX="+x+",left="+x+",screenY="+y+",top="+y); 
	if (newwin.focus) newwin.focus();
	if (!newwin.opener) {
		newwin.opener = self;
	}
}

function Popup2(p_url,p_width,p_height,p_scroll,p_name) {	
	var ScrWidth = screen.width;
	var ScrHeight = screen.height;
	var x = ((ScrWidth - p_width)/2);
	var y = ((ScrHeight - p_height)/2);
	if (Popup2.arguments.length < 5) {
		p_name = "name"+ x;
	}

	if (Popup2.arguments.length < 4) {
		p_scroll = "no";
	}
	 
	window.open(p_url,p_name, "channelmode=no,dependent=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars="+p_scroll+",status=no,toolbar=no,width="+p_width+",height="+p_height+",screenX="+x+",left="+x+",screenY="+y+",top="+y); 
}

function PopFull(p_url,p_name) {
	var ScrWidth = screen.width - 40;
	var ScrHeight = screen.height - 40;	
	window.open(p_url,p_name,"width="+ScrWidth+",height="+ScrHeight+"screenX=0,screenY=0,left=0,top=0,menubar=no,location=no,scrollbars=yes,toolbar=no,status=no");
}

function DeleteVerify(p_url)
{
    if (confirm("Are You Sure You want to Delete?") == true) {
	    window.location = p_url;
	}
}

function CheckAll(Field, LoopMax, TrueFalse)
{	
	for(var loopndx = 0; loopndx < LoopMax; loopndx++)
	{
	Field(loopndx).checked = TrueFalse;
	}
}

function GetBrowser(){
	var DOM ,NS4, IE, IE4, Mac, IE4M, IE5M, IE5W, NS6;

	DOM = (document.getElementById) ? true : false;
	NS4 = (document.layers) ? true : false;
	IE = (document.all) ? true : false;
	IE4 = IE && !DOM;
	Mac = (navigator.appVersion.indexOf("Mac") != -1);
	IE4M = IE4 && Mac;

	if (DOM) {
		IE5M = IE && Mac;
		IE5W = IE && !Mac;
		NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
	}

	if(NS4 || NS6){
		return "NS";
	}
	if(Mac){
		return "Mac";
	}
	if(IE){
		return "IE";
		
	return "??";
	}
}