function confirmAdd()
	{
	var agree=confirm("Are you sure you want to add this record?");
	if (agree)
		return true ;
	else
		return false ;
	}
	
	function confirmUpdate()
	{
	var agree=confirm("Are you sure you want to update this record?");
	if (agree)
		return true ;
	else
		return false ;
	}
	
	function confirmDelete()
	{
	var agree=confirm("Are you sure you want to delete this record?");
	if (agree)
		return true ;
	else
		return false ;
	}
	
	function buildurcars()
	{
		var agree=confirm("The items you selected for your car will be removed");
		if (agree){
			document.buildurcar.submit();
			return true ;
		}else{
			return false ;
		}
	}
/****************************************Drop Down & Rollover Menu  ********************************/
function MM_swapImgRestore() { 
  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_swapImage() {
  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_findObj(n, d) {
	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;
}
/****************************************Drop Down & Rollover Menu ********************************/

/**************************************** Tabs ************************************************/
function generaltab(g,generaltabscount){
for(var d=1;d<(generaltabscount+1);d++){	    
	var generalt = document.getElementById('generaltab'+d);
		if(d==g){
			generalt.style.display='block';
			document.getElementById("tabhead"+d).className="tabsbackon";
		}
		else{
			generalt.style.display='none';
			document.getElementById("tabhead"+d).className="tabsback";
		}
	}
}
/**************************************** Tabs ************************************************/

function validateEmail(NForm,remail) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = NForm.remail.value;
   if(reg.test(address) == false) {
      alert(address);
      return false;
   }
}


//////////////Validate Career/////////
function validate_careerform(NForm){
 	return  checkForm(NForm) &&
 			true;
}


function checkForm(NForm){
   if(NForm.rname.value == "" || NForm.rname.value == null) {
        var stopinput=1;
        obj = document.getElementById('rname');
        obj.style.display = "";
        
        NForm.rname.focus();
        //alert(screen.width);
        
        $.msg('Full Name is required<br><br>','contacterr','#merr','');
        return false;
    }else{
    		
    } 
 
    if(NForm.remail.value == "" || NForm.remail.value == null || validateEmail(NForm,document.getElementById('remail'))==false) {
      var stopinput=1;
      obj = document.getElementById('remail');
      obj.style.display = "";
      NForm.remail.focus();
      $.msg('Invalid Email Address<br><br>','contacterr','#merr','');
       return false;
       
    }
    
		
		//////


		

    if(NForm.userfile.value == "" || NForm.userfile.value == null) {
        var stopinput=1;
        $.msg('Only DOC and PDF files are supported. Please try again<br><br>','contacterr','#merr',5000);
        //alert("Please Upload Your Resume");
        
          return false;
      } else {
          validformFile = /(.docx|.DOCX|.doc|.DOC|.pdf|.PDF)$/;

          if(!validformFile.test(NForm.userfile.value)){
          	
            $.msg('Only DOC and PDF files are supported. Please try again<br><br>','contacterr','#merr',5000);
            //alert("Only DOC and PDF files are supported. Please try again");
            return false;
              
          }
      }
		
		// $.msg('Thank you for submitting your resume<br>It will be revised by the human resources department<br><br>','graycolor','#merr',8000);
     return true;
    	
    
		
	} 
    

function validate_formcat(cid) {
	vart= eval("document."+ cid +".catid.selectedIndex");
	  if ( vart == 0 )
    {
        alert ( "Please Select A Category to manage" );
        return false;
    }
    else eval("document." +cid+ ".submit();")
}
