// JavaScript Document

  // Handles updating the visibility of the "date line" textbox when the user changes the design
  // (When an option containing 'skyline' is selected, we do not display the dateline)
  //
  // the 'designSelectBox' and 'headingLine' can be passed in when the function is called

  function handleDesignChange() {
    var selectBox = document.getElementById('designSelectBox');
    var optionText = selectBox.options[selectBox.selectedIndex].text;
    var textBox = document.getElementById('headingLine');
    if (optionText.indexOf('skyline') > 0) {
        textBox.disabled = true;
    } else {
        textBox.disabled = false;
    }
  }


  function checkLength(textarea, maxlen) {
      if (textarea.value.length > maxlen) {
         alert("Text fields must be " + maxlen + " characters or less.");
   }
  }


	function imageView(myImage,popupWinName,w,h,x,y){
	preview = window.open("", popupWinName,
	"resizable=no,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width="+w+",height="+h+",left="+x+",top="+y+"");
	preview.document.write('<html><head><title>Click image to close window<\/title><\/head>'
	+'<body onBlur="self.focus();" marginWidth="0" marginHeight="0" topmargin="0" leftmargin="0">'

	+'<center><a href="javascript:self.close()"><img border="0" alt="click image to close window" src="'+myImage+'" width="'+w+'" height="'+h+'">'

	+'<\/center><\/a><\/body><\/html>');

	preview.document.close();
	}
	
	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_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 P7_hideEl(evt) { //v1.6 by PVII-www.projectseven.com
 var b,r,m=false;if(document.layers){b=evt.target;if(b.p7aHide){
 b.visibility="hidden";}else{routeEvent(evt);}
 }else if(document.all&&!window.opera){b=event.srcElement;while(b){
 if(b.p7aHide){break;}b=b.parentElement;}if(!b.contains(event.toElement)){
 b.style.visibility="hidden";}}else if(document.getElementById){
 b=evt.currentTarget;r=evt.relatedTarget;while(r){if(b==r){m=true;
 break;}r=r.parentNode;}if(!m){b.style.visibility="hidden";}}
}

function P7_autoHide() { //v1.6 by PVII-www.projectseven.com
 var i,g;for(i=0;i<arguments.length;i++){
 if((g=MM_findObj(arguments[i]))!=null){g.p7aHide=true;if(document.layers){
 g.captureEvents(Event.MOUSEOUT);}
 if(g.addEventListener){g.addEventListener("mouseout",P7_hideEl,true);
 }else if(g.attachEvent){g.attachEvent("onmouseout",P7_hideEl);
 }else{g.onmouseout=P7_hideEl;}}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

