function validateForm(obj, obj2, obj3, obj4, obj5)
{
	//alert(obj4.value);
	if(obj.value == '')
	{
		alert("Can not leave this field blank!");
		obj.focus();
		obj.style.backgroundColor = "#FFCC99";
		return false;
	}
	else if(obj4.value == '0')
	{
		alert("Silahkan pilih jenis fastel");
		obj4.focus();
		obj4.style.backgroundColor = "#FFCC99";
		return false;
	}
        else if(obj2.value == '')
	{
		alert("Can not leave this field blank!");
		obj2.focus();
		obj2.style.backgroundColor = "#FFCC99";
		return false;
	}
	else if(obj3.value == '')
	{
		alert("Security code is required!");
		obj3.focus();
		obj3.style.backgroundColor = "#FFCC99";
		return false;
	}
	else if(obj5 == null)
	{
		alert("Anda belum memilih survey kepuasan pelanggan");
		return false;
	}
	Else
	{
		 
		var erridx = 0;
		var intTmp = obj.value.search("[^A-Za-z0-9]");
		var intTmp2 = obj2.value.search("[^0-9]");
	        if(obj.value.length > 0 &&  intTmp >= 0) 
	        {
	            erridx++;
	        }
	        
	        if(obj2.value.length > 0 &&  intTmp2 >= 0) 
	        {
	            erridx2++;
	        }
	        
		if(erridx>0)
		{
			obj.focus();
		        obj.style.backgroundColor = "#FFCC99";
		        alert("This field must be numeric or alphanumeric!");
			return false;
		}
		else
		{
			return true;
		}
		
		if(erridx2>0)
		{
			obj2.focus();
		        obj2.style.backgroundColor = "#FFCC99";
		        alert("This field must be numeric!");
			return false;
		}
		else
		{
			return true;
		}
	}
}

var cutsheet=null;
function cutsheetOpen(aURL, aWidth, aHeight, aResize) {
    var dWidth = "700";
    var dHeight= "700";
    var dResize = "no";
    if (aWidth) dWidth = aWidth;
    if (aHeight) dHeight = aHeight;
    if (aResize) dResize = "yes";

    if (!cutsheet || cutsheet.closed ) {
        if (aResize)    cutsheet=window.open(aURL,"cutsheet","width="+dWidth+",height="+dHeight+",top=10,left=10,resizable=yes,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
        else            cutsheet=window.open(aURL,"cutsheet","width="+dWidth+",height="+dHeight+",top=10,left=10,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no");
        //cutsheet=window.open(aURL,'cutsheet');
        if (cutsheet.focus) cutsheet.focus();
        //if (!cutsheet.opener) cutsheet.opener = self;
    } else {
        cutsheet.location=aURL;
        if (cutsheet.focus) cutsheet.focus();
    }
    return false;
}

// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005
// you may copy this function but please keep the copyright notice with it
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;
}
                  
