// Rollover scripts by Macromedia Dreamweaver.

// How to use:

// MM_swapImage() is used in onmouseover event in either <a> or <img> tags to swap the image src into a rollover state image.  2 parameters are required for simple rollovers. The <img> name and the rollover image file path, e.g onmouseover="MM_swapImage('imgTagName','','rolloverImagePath',1);".  The second and fourth parameters are optional.
// 

// MM_swapImgRestore() is used in onmouseout event in either <a> or <img> tags to restore the image to it's original state after rollover.  No parameters are required.  example: onmouseout="MM_swapImgRestore()"

// MM_preloadImages() is used in onload event in <body> tag to preload rollover state images, so that there will be no load time for the first rollover.  Parameters for this function is the list of image files to be preloaded. for example: onload="MM_preloadImages('','images/button_print_roll.gif','images/button_export_roll.gif','images/button_myreports_roll.gif','images/button_display_roll.gif','images/button_prev_roll.gif','images/button_next_roll.gif','images/button_compare_roll.gif')"

//  MM_findObj() is not used in any event of the HTML tag, it's a support function that's used implicitly by MM_swapImage() and MM_swapImgRestore().

// 

<!--
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_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_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


//-->

<!-- Original:  Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site:  http://www7.ewebcity.com/cyanide7 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// test variables
var mywidth = 450;
var myHeight = 200;
var isResizable = false;

function createTarget(form) {
  _target = form.target;
  _colon = _target.indexOf(":");
  if(_colon != -1) {
    form.target = _target.substring(0,_colon);
    form.args = _target.substring(_colon+1);
  } else if(typeof(form.args)=="undefined") {
    form.args = "";
  }
  if(form.args.indexOf("{")!=-1) {
    _args = form.args.split("{");
    form.args = _args[0];
    for(var i = 1; i < _args.length;i++) {
      _args[i] = _args[i].split("}");
      form.args += eval(_args[i][0]) + _args[i][1];
    }
  }
  form.args = form.args.replace(/ /g,"");
  _win = window.open('',form.target,form.args);
  if(typeof(focus)=="function")
    _win.focus();
  return true;
}
//  End -->


//Non empty field validation function
function checkemptyfields (){
  var alertstring, tempstring, tempvalue;
  var i;
  
  alertstring = 'You must enter ';
  tempstring = '';
  tempvalue = '';
  
  for(i=1; i < arguments.length; i++){
    if (eval('document.forms[' + arguments[0] + '].' + arguments[i] + '.value == \'\'')){
	  if(tempstring==''){
	    tempstring = arguments[i];
	  }else{
	    tempstring = tempstring + ', ' + arguments[i];
	  }
	}
  }
  
  if(tempstring !=''){
    alertstring = alertstring + tempstring + ' to proceed.';
	alert(alertstring);
	return false;
  }else{
    return true;
  }

}


function confirmfields (theform, field1, field2, fieldname){
  var value1, value2;
  
  value1 = eval('document.' + theform + '.' + field1 + '.value');
  value2 = eval('document.' + theform + '.' + field2 + '.value');
  
  if (value1 == value2){
    return true;
  }else{
    alert('The ' + fieldname + ' fields do not match, please try again');
    return false;
  }
}


function confirmcheckfields (theform, fieldname_prefix, confirmmsg) {

  var tempstring, tempfieldname;
  
  tempfieldname = '';
  tempstring = '';

  for (i = 0; i < document.forms[theform].length; i++){
    tempfieldname = document.forms[theform].elements[i].name;
    if(tempfieldname.search(fieldname_prefix) == 0 && document.forms[theform].elements[i].checked == true){
	  if(tempstring == ''){
	    tempstring = document.forms[theform].elements[i].value;
	  }else{
	    tempstring = tempstring + ', ' + document.forms[theform].elements[i].value;
	  }
	} 
  }
  
  if(tempstring != ''){
    return confirm(confirmmsg);
  }else{
    return false;
  }
}











