// JavaScript Document
function set_tab_class(div_nm,clasnm){
	document.getElementById(div_nm).className = clasnm;
}

function con_check(){ 		
		
	if(!validate_text(document.con_ff.name,1,"Please enter Name")){
		 return false;
	}
			 
	if(!validate_email(document.con_ff.email,1,"Please enter Email Address")){
		 return false;
	} 
	
			 
	if(!validate_text(document.con_ff.mess,1,"Please enter Comments/Request")){
		 return false;
	}
	 
	if(!validate_text(document.con_ff.captcha,1,"Please enter Confirmation Code")){
		return false;
	}  

    return true;  
}

function news_check(){	
	 
	 if(!validate_email(document.news_ff.email,1,"Please enter Email Address")){
	    return false;
	 }	 
		
     return true;
}

function login_check(){
	if(!validate_email(document.m_lgn.t1,1,"Please enter Email Address")){
	    return false;
	}
	
	if(!validate_text(document.m_lgn.t2,1,"Please enter Password")){
	    return false;
	}
	
	return true;
}

function pass_check(){
	if(!validate_email(document.pass_ff.un_em,1,"Please enter Email Address")){
	    return false;
	}
	
	return true;
}

function searchform(){
	if(!validate_text(document.skey.pkeyword,1,"Please enter the search Keyword")){
	  return false;
    }
	
	svl = document.skey.pkeyword.value;
	if (svl == "Search Product"){
		document.skey.pkeyword.value = "";
		alert ("Please enter the search Keyword");
		return false;
	}
	return true;
}

function f_order_det(aa)
   {  
	var url = 'order-det.php?id='+aa;
	var ttl = 'Order';
	var params = 'status=yes, resizable=yes ,width=750px, height=500px, top=10px, left=10px, scrollbars=yes';
	window.open(url, ttl, params);
   }

function jump_page(p, gotopagenm, extraqry){
	location.href = gotopagenm + '?p=' + p + extraqry;
}

function pageitemgo(){
 location.href = document.pgnat.gotourl.value + "&pageitem=" + document.pgnat.pageitem.value;
}
function pageitemgo_1(){
 location.href = document.pgnat_1.gotourl.value + "&pageitem=" + document.pgnat_1.pageitem.value;
}
   
function pageitemgo_sort(){
 location.href = document.pgnat.gotourl.value + "&sby=" + document.pgnat_sort.sby.value + "&pageitem=" + document.pgnat.pageitem.value;
}
function pageitemgo_sort_1(){
 location.href = document.pgnat_1.gotourl.value + "&sby=" + document.pgnat_sort_1.sby.value + "&pageitem=" + document.pgnat_1.pageitem.value;
}

function post_bid(pid, foldpath){
	if(!validate_pnumeric(document.getElementById("bid_amt"),1,"Please enter your BID Amount")){
	  return;
    }
	
	cur_bid = document.getElementById("bid_amt").value;
	cur_bid = eval(cur_bid);
	
	bid_inc = document.getElementById("bid_inc").value;
	bid_inc = eval(bid_inc);
	
	if (cur_bid < bid_inc){
	 alert ("You BID Amount is Invalid");
	 document.getElementById("bid_amt").select();
	 return;
	}
	
	location.href = foldpath + "postbid.php?pid=" + pid + "&bid_amt=" + cur_bid;
}
