function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if (selObj.options[selObj.selectedIndex].value != "")
  {
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
  }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
//  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
//    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
//  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
//}
//MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function readcookies(key) {
	var allcookies = document.cookie;
	
	if (allcookies != null) {
		var cookiepos = allcookies.indexOf(key);
		
		if (cookiepos != -1) {
			var cookiestart = cookiepos + key.length + 1;
			var cookieend = allcookies.indexOf(";", cookiestart);
			if (cookieend == -1) {
				cookieend = allcookies.length;
			}
			var cookievalue = allcookies.substring(cookiestart, cookieend);
			return unescape(cookievalue);
		}
	}
	return null;
}

function writecookies(key, target) {
	document.cookie += key + "=" + escape(target);
}




var link_nohandler= window.clientInformation? null : window.undefined; 

function link_down() { this.onfocus= this.blur; } 

function link_up() { this.onfocus= link_nohandler; } 

function link_bind() { 
	for (var i= document.links.length; i-->0;) {  
		document.links[i].onmousedown= link_down;
		document.links[i].onmouseup= link_up; 
	}
}

function totxtbox(formName, controlName, cardno) {
	obj=eval("document."+formName+"."+controlName);
	obj.value = cardno
}

function SetCtrlVal(ctrlName, ctrlVal) {	
	var obj = document.getElementById(ctrlName);
	if ( obj != null )
	{
		document.getElementById(ctrlName).value=ctrlVal;
	}
}
/*
function SetCtrlVal(ctrlName, ctrlVal) {	
	document.getElementById(ctrlName).value=ctrlVal;
}
*/

function GetCtrlVal(ctrlName) {
	return document.getElementById(ctrlName).value;
}

function SetCtrlIndex(ctrlName, ctrlVal) {	
	var obj = document.getElementById(ctrlName);
	if ( obj != null )
	{
		document.getElementById(ctrlName).selectedIndex=ctrlVal;
	}
}

function SetCtrlDisable(ctrlName, ctrlVal) {	
	var obj = document.getElementById(ctrlName);
	if ( obj != null )
	{
		document.getElementById(ctrlName).disabled=ctrlVal;
	}
}

function MM_swapImageEx(a, b, c, d, IsFront) { //v3.0	
	//var obj = document.getElementById('_hidSelectFileName');	
	//window.alert(obj.value);
	var e = document.getElementById(c).value;	
	MM_swapImage(a, b, e, d);
	if ( IsFront == 1 )
	{
		//window.alert("front");
		document.getElementById('_hidFrontFilePath').value = e;
		document.getElementById('_hidFrontFileName').value = document.getElementById('_hidSelectFileName').value;		
	}
	else
	{
		//window.alert("back");
		document.getElementById('_hidBackFilePath').value = e;
		document.getElementById('_hidBackFileName').value = document.getElementById('_hidSelectFileName').value;
	}
	
}

function MM_swapImageClear(a, b, c, d, IsFront) { //v3.0	
	
	MM_swapImage(a, b, c, d);
	if ( IsFront == 1 )
	{	
		document.getElementById('_hidFrontFilePath').value = c;
		document.getElementById('_hidFrontFileName').value = "";
	}
	else
	{		
		document.getElementById('_hidBackFilePath').value = c;
		document.getElementById('_hidBackFileName').value = "";
	}
	
}

function showhideinfo(info, img) {
   obj=document.getElementById(info);
	if (document.getElementById(info+'_now').checked)
	{
   imgobj=document.getElementById(img);
   visible=(obj.style.display!="none")
   if (visible) {
        obj.style.display="none";
        imgobj.src = 'images/icon_show.gif';
      }else{
        obj.style.display="block";
        imgobj.src = 'images/icon_hide.gif';
      }
	}
}

function showhidectrl(info, img, flag) {
   obj=document.getElementById(info);
   imgobj=document.getElementById(img);
   if (flag==1) {
		obj.style.display="block";
        imgobj.src = 'images/icon_hide.gif';
	  }else{
        obj.style.display="none";
        imgobj.src = 'images/icon_none.gif';
	  }
}

function showhideinfo2(info, img) 
{
	obj=document.getElementById(info);
/*
	if ( document.getElementById('select_' + info).value == 0 )
	{
	*/
		imgobj = document.getElementById(img);
		visible = (obj.style.display!="none");
		if ( visible ) 
		{
			obj.style.display ="none";
			imgobj.src = 'images/icon_show.gif';
		}
		else
		{
			obj.style.display="block";
			imgobj.src = 'images/icon_hide.gif';
		}
	//}
}

function showDown(evt) 
{
	evt = (evt) ? evt : ((event) ? event : null);

    if (evt) 
    {
		if (   evt.keyCode == 8 && 
				(evt.srcElement.type != "text" && evt.srcElement.type != "textarea" && evt.srcElement.type != "password")   ) 
		{
			// When backspace is pressed but not in form element
			cancelKey(evt);
		}
		else if (   evt.ctrlKey && 
					(evt.keyCode == 78 || evt.keyCode == 82)   ) 
		{
			// When ctrl is pressed with R or N
			cancelKey(evt);
		}
		else if ( evt.keyCode == 116 && (evt.type == "keyup" || evt.type == "keydown"))
		{
			// When F5 is pressed
			cancelKey(evt);
		}
	}
}

/*
function showDown(evt) 
{
	evt = (evt) ? evt : ((event) ? event : null);

    if (evt) 
    {
		if (   event.keyCode == 8 && 
				(event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password")   ) 
		{
			// When backspace is pressed but not in form element
			cancelKey(evt);
		}
		else if (   event.ctrlKey && 
					(event.keyCode == 78 || event.keyCode == 82)   ) 
		{
			// When ctrl is pressed with R or N
			cancelKey(evt);
		}
	}
}
*/

function cancelKey(evt) 
{
	if ( evt.preventDefault ) 
	{
		evt.preventDefault();
        return false;
    }
    else 
    {
		evt.keyCode = 0;
        evt.returnValue = false;
    }
}

function disableKey()
{
	if ( navigator.appName=="Netscape" ) 
	{
		document.addEventListener("keypress",showDown,true);
    }

    document.onkeydown  = showDown;
}

/*
function clickIE4()
{
	if ( event.button == 2 )
	{
		alert('IE: right click');
		return false;
	}
}

function clickNS4(e)
{
	if ( document.layers ||
		 document.getElementById &&
		 !document.all )
	{
		if ( e.which==2 || e.which==3 )
		{
			alert('NS: right click');
			return false;
		}
	}
}
*/

function disableRclick()
{
	document.oncontextmenu=new Function("return false")
	/*
	if ( document.layers )
	{
		document.captureEvents(Event.MOUSEDOWN);
		document.onmousedown=clickNS4;
	}
	else if ( document.all && !document.getElementById )
	{
		document.onmousedown=clickIE4;
	}
	*/
}

template = "			<div id=\"slayer_1\" style=\"FONT-WEIGHT: normal; TEXT-ALIGN: left; FONT-SIZE: 16px; Z-INDEX: 1; LEFT: 0px; TOP: 0px; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none;  POSITION: absolute;\" noWrap runat=\"server\" onclick=\"loadprop('layer_1');\">text_1<span id=\"layer_1\" style=\"COLOR: black; POSITION: absolute; TOP: -2; LEFT: -2; DISPLAY: none; TEXT-ALIGN: left;\">text_1</span></div>";
//template = "			<div id=\"slayer_1\" style=\"FONT-WEIGHT: normal; TEXT-ALIGN: left; FONT-SIZE: 16px; Z-INDEX: 1; LEFT: 0px; TOP: 0px; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none;  POSITION: absolute;\" noWrap runat=\"server\" onclick=\"loadprop('layer_1');\">text_1<span id=\"layer_1\" style=\"COLOR: black; POSITION: absolute; TOP: -2; LEFT: -2; DISPLAY: none; TEXT-ALIGN: left;\">text_1</span></div>";
spantemplate = "		<span id=\"layer_1\" style=\"COLOR: black; POSITION: absolute; TOP: -2; LEFT: -2; TEXT-ALIGN: left;\">text_1</span>";
imgtemplate = "			<img id=\"img_1\" width= height=  src=\"abc\" style=\"LEFT: 0px; POSITION: absolute; TOP: 0px;  Z-INDEX: 1;\" runat=\"server\" onclick=\"sel_img('img_1');\">";
//template = "			<div id=\"slayer_1\" style=\"FONT-WEIGHT: normal; FONT-SIZE: 16px; Z-INDEX: 1; LEFT: 0px; TOP: 0px; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none;  POSITION: absolute; BACKGROUND-COLOR: transparent;\" noWrap runat=\"server\" onclick=\"loadprop('layer_1');\">text_1<span id=\"layer_1\" style=\"COLOR: black; POSITION: absolute; TOP: -2; LEFT: -2; BACKGROUND-COLOR: transparent; DISPLAY: none;\">text_1</span></div>";
//spantemplate = "		<span id=\"layer_1\" style=\"COLOR: black; POSITION: absolute; TOP: -2; LEFT: -2; BACKGROUND-COLOR: transparent;\">text_1</span>";
//imgtemplate = "			<img id=\"img_1\" src=\"abc\" style=\"LEFT: 0px; POSITION: absolute; TOP: 0px;  Z-INDEX: 1; background-color:transparent;\" runat=\"server\" onclick=\"sel_img('img_1');\">";
//template = "			<div id=\"layer_1\" style=\"FONT-WEIGHT: normal; FONT-SIZE: 16px; Z-INDEX: 1; LEFT: 0px; TOP: 0px; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none;  POSITION: relative;\" noWrap onclick=\"loadprop('layer_1');\">text_1</div>";
//imgtemplate = "			<img id=\"img_1\" style=\"LEFT: 0px; POSITION: absolute; TOP: 0px\" onclick=\"sel_img('img_1');\">";
hidtemplate = "			<input id=\"hid_x_layer_1\" type=\"hidden\" value=\"300\" runat=\"server\"><input id=\"hid_y_layer_1\" type=\"hidden\" value=\"300\" runat=\"server\"><input id=\"hid_name_layer_1\" type=\"hidden\" value=\"text_1\" runat=\"server\"><input id=\"hid_fontname_layer_1\" type=\"hidden\" value=\"Arial\" runat=\"server\"><input id=\"hid_fontsize_layer_1\" type=\"hidden\" value=\"16\" runat=\"server\"><input id=\"hid_bold_layer_1\" type=\"hidden\" value=\"normal\" runat=\"server\"><input id=\"hid_italic_layer_1\" type=\"hidden\" value=\"normal\" runat=\"server\"><input id=\"hid_ul_layer_1\" type=\"hidden\" value=\"false\" runat=\"server\"><input id=\"hid_fontcolor_layer_1\" type=\"hidden\" value=\"black\" runat=\"server\"><input id=\"hid_shadow_layer_1\" type=\"hidden\" value=\"false\" runat=\"server\">";
hidimgtemplate = "		<input id=\"hid_x_img_1\" type=\"hidden\" value=\"0\" runat=\"server\"><input id=\"hid_y_img_1\" type=\"hidden\" value=\"0\" runat=\"server\"><input id=\"hid_w_img_1\" type=\"hidden\" value=\"0\" runat=\"server\"><input id=\"hid_h_img_1\" type=\"hidden\" value=\"0\" runat=\"server\"><input id=\"hid_src_img_1\" type=\"hidden\" value=\"\" runat=\"server\">";
actiontemplate = "		ADD_DHTML(\"slayer_1\"+CURSOR_MOVE+MAXOFFBOTTOM+200+MAXOFFLEFT+0+MAXOFFRIGHT+300+MAXOFFTOP+0);";
imgactiontemplate = "	ADD_DHTML(\"img_1\"+CURSOR_MOVE+SCALABLE+MAXOFFTOP+0+MAXOFFLEFT+0+MAXWIDTH+393+MAXHEIGHT+239);";
//imgactiontemplate = "	ADD_DHTML(\"img_1\"+CURSOR_MOVE+SCALABLE+MAXOFFTOP+0+MAXOFFLEFT+0);";
//imgactiontemplate = "	ADD_DHTML(\"img_1\"+CURSOR_MOVE+SCALABLE+RESET_Z);";

function hidestatus()
{
	// adding to all a href:  onMouseover="return hidestatus()"
	var statusmsg = "Print100 Global";
	window.status = statusmsg;
	return true;
}

function hideAllStatus()	// disable all link shown on status bar
{
	if (document.layers)
		document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

	document.onmouseover = hidestatus
	document.onmouseout = hidestatus
}

function MyOpenWin(url)
{
	//window.alert("inside MyOpenWin");
	var adjHeight=560;
	/*
	if (navigator.appName.toLowerCase().indexOf("microsoft") != -1)
	{
		adjHeight = screen.availHeight - (screen.Height - screen.availHeight) -50;	// cut out the height of title bar
	} 
	else
	{
		adjHeight = screen.availHeight -50;
	}
	*/
	adjHeight = screen.availHeight -50;
	if (adjHeight < 560) 
	{
		adjHeight = 560;
	}
	var adjLeft = (screen.availWidth - 800) / 2;
	if (adjLeft < 0) {adjLeft = 0;}
	//win = window.open(url, '_blank', 'menubar=no, toolbar=no, scrollbars=yes, width=' + screen.availWidth + ', height=' + adjHeight);
	//win = window.open(url, 'myprint100', 'menubar=no, toolbar=no, scrollbars=yes, width=720' + ', height=' + adjHeight);

	window.open(url, 'myprint100', 'menubar=no, toolbar=no, scrollbars=yes, width=800' + ', height=' + adjHeight);
	//win.moveTo(adjLeft,0);
	//win.focus();
}

function loadcontents() {
var movie = window.document.contents
movie.LoadMovie(1, "contents.swf");
}

function myprint100(url){
//MM_openBrWindow(url,'myprint100','scrollbars=yes,width=720,height=560');
MyOpenWin(url);
}

function movie(url) {
var newurl= (baseurl+'html/'+url);
MM_openBrWindow( newurl,'finishinghelp','width=630,height=503');
}
function help(url) {
var newurl= (baseurl+'images/'+url);
MM_openBrWindow( newurl,'help','width=630,height=503');
}
function details(url) {
MM_openBrWindow( url,'details','width=600,height=460,scrollbars=yes');
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function resetform(formname) {
   document.forms[formname].reset();
}