

function IsEmpty(field) {
   if ((field.value.length==0) ||   (field.value==null)) {
      return true;
   }
   else {
   	if (field.value==""){
		return true;
	}
	else
   		return false;
   }
}

function removeblanks(fld)
{
	var res = "";
	var c = 0;
	for (i=0; i<fld.length; i++) {
	  if (fld.charAt(i) != " " || c > 0) {
	    res += fld.charAt(i);
	    if (fld.charAt(i) != " ") c = res.length;
	    }
	  }
	  fld.value=res.substr(0,c);
	return res.substr(0,c);
}

// This is the function that will open the
// new window when the mouse is moved over the link
// to call this
// <a href="#"  onMouseOver="open_new_window()" onMouseOut="close_window()">Open Hover Window</a>
function open_new_window(msg) 
{
new_window = open("","hoverwindow","width=300,height=200,left=10,top=10");

// open new document 
new_window.document.open();

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail
new_window.document.write("<html><title>Message</title>");
new_window.document.write("<body bgcolor=\"#FFFFFF\">");
new_window.document.write(msg);
new_window.document.write("<br>");
new_window.document.write("</body></html>");

// close the document
new_window.document.close(); 
}

// This is the function that will close the
// new window when the mouse is moved off the link
function close_window() 
{
new_window.close();
}
 
function open_window(url) {
window.open(url,"coupon","menubar=no,",true); 
}

// start button
function goLite(FRM,BTN) {
alert("golite");
   window.document.forms[FRM].elements[BTN].style.color = "#000000";
   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url('../images/buttonbluea.gif')";
}

function goDim(FRM,BTN) {
alert("godim");
   window.document.forms[FRM].elements[BTN].style.color = "#ffffff";
   window.document.forms[FRM].elements[BTN].style.backgroundImage = "url('../images/buttonbluea.gif')";
}

//end button


function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

