// JavaScript Document

document.write ('<link rel="stylesheet" type="text/css" href="http://www.ghanaauction.com/css/tree_styles.css">')
document.write ('<link rel="stylesheet" type="text/css" href="http://www.ghanaauction.com/css/text.css" >')
document.write ('<link rel="stylesheet" type="text/css" href="http://www.ghanaauction.com/css/htmlarea.css" >')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/htmlarea.js"></script>')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/en.js"></script>')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/dialog.js"></script>')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/popupwin.js"></script>')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/TableOperations/table-operations.js"></script>')
document.write('<script type="text/javascript" src="http://www.ghanaauction.com/scripts/TableOperations/lang/en.js"></script>')


function printwindow(t){
		var theForm = opener.document.regform
		   for(i=0; i<t.elements.length; i++){
	  
			  if(t.elements[i].type == "text"){
				   for(j=0;j<theForm.elements.length;j++){								   
						if(t.elements[i].name==theForm.elements[j].name)
							t.elements[i].value=theForm.elements[j].value;
				   }
			  }
			  else if(t.elements[i].type == "checkbox" || t.elements[i].type == "radio"){
			  //alertText += "" + t.elements[i].name + ":";	
			  
				if(t.elements[i].name=="terms"){									
					for(j=0;j<theForm.elements.length;j++){								   
						if(t.elements[i].name==theForm.elements[j].name)
							t.elements[i].checked=theForm.elements[j].checked;
				   }
				}
				if(t.elements[i].name=="gender"){
					for(j=0;j<theForm.elements.length;j++){
						if(t.elements[i].name==theForm.elements[j].name && t.elements[i].value==theForm.elements[j].value)
							t.elements[i].checked=theForm.elements[j].checked;
					}
				}

			// alertText +=t.elements[i].checked + "\n"
			}
		//  alert(alertText)
	   }
		//vg.document.write(alertText);
	
	return false;
}

function openprintwindow(t,p){
	p=p+'seller/print.php';	
	vg=window.open(p,'test');
	if(vg){
									
	}
	return false;
}

function ffunshowfill(form,min_res)
{
	 if (form.ddtypesel[0].checked){
		form.additional_info.value='Amount Deposited';
		form.min_amout1.value = min_res;
	}
	 if (form.ddtypesel[1].checked){
		form.additional_info.value='Gb Deposit';
		form.min_amout1.value = min_res;
	}
}


function fun_nav(t){
			if(t){
				window.opener.location.href=t.href;
				window.close()
			}
			return false;
	
}


function funmusicradio(p){								
		st=p+'mymusic.php';
		return MM_openBrWindow(st,'RadioMusic');
	
}

function adm_mymusic_validate(s1){
	if (trim(s1.seller_logo.value)==""){
		alert("Upload banner image")
		return false
	}
	if (trim(s1.tagname.value)==""){
		alert("Please enter name")
		s1.tagname.focus()
		return false
	} 
}



var vxTimer=null;
var vxmidTimer=null;
var vxTimerURL=null;
function checkTimeOutUser(r){
	vxmidTimer=setTimeout("checkTimeOutFinalUser()",900000);
	if(confirm('The page would close for no activity.\n User may stop closure by getting active again.')){
		//vxTimer=setTimeout("checkTimeOutUser()",600000);lalit
		vxTimer=setTimeout("checkTimeOutFinalUser()",300000);
		clearTimeout(vxmidTimer);
	}else{
		clearTimeout(vxTimer);
		clearTimeout(vxmidTimer);
		//location.href=vxTimerURL+'validate.php?work=signout';
	}
}

function checkTimeOutFinalUser(r){
		clearTimeout(vxTimer);
		clearTimeout(vxmidTimer);
		location.href=vxTimerURL+'validate.php?work=signout';	
}

function setTimeOutUser(r){
	vxTimerURL=r;
	vxTimer=setTimeout("checkTimeOutUser()",900000);
}

function funbanimg(p){

	var th=document.getElementById("seller_logo")
	if(th){
		st=p+'test/index.php?fp=banner_images/'+th.value;
		return MM_openBrWindow_banner(st,'PopUp');
	}
}

function dispminimum_dep(t , type){

	if (type == "auction")
	{
		
		if(t.value=="1")
		{
			document.getElementById("shoToolTip").innerHTML ='Any registered member of the GhanaAuction trading<br/> platform can bid on this item.';
		}
		if(t.value=="2")
		{
			document.getElementById("shoToolTip").innerHTML ='A Guaranteed Buyers can bid on this item.<br/>A Guaranteed Buyer has made the minimum<br/>required deposit to secure / guarantee all<br/>bids placed. Activate your Guaranteed Buyer<br/>status from your account profile.';
		}	
		if(t.value=="3"){
			document.getElementById("shoToolTip").innerHTML ='A bidder must first qualify as a<br/>guaranteed buyer, and then also, must<br/>make the minimum deposit indicated<br/>by the seller to bid on this item.';
			t.form.bidallowed_min.style.display='';
		}else{ 
			t.form.bidallowed_min.style.display='none';
		}
	}else if (type == "estore")
	{
		if(t.value=="1")
		{
			document.getElementById("shoToolTip").innerHTML ='Any registered member of the GhanaAuction trading platform.';
		}
		if(t.value=="2")
		{
			document.getElementById("shoToolTip").innerHTML ='A Guaranteed Buyers can buy this item.<br/>A Guaranteed Buyer has made the minimum<br/>required deposit to secure / guarantee all<br/>purchases.Activate your Guaranteed Buyer<br/>status from your account profile.';
		}	
		if(t.value=="3"){
			document.getElementById("shoToolTip").innerHTML ='A buyer must first qualify as a guaranteed<br/>buyer, and then also, must make the minimum<br/>deposit indicated by the seller.';
			t.form.bidallowed_min.style.display='';
		}else{ 
			t.form.bidallowed_min.style.display='none';
		}
	}
	
}


function paysettings(form)
{
	radio_choice=false;
	for (counter = 0;  counter <form.lev1.length; counter++)
   {
   	 if (form.lev1[counter].checked){
       radio_choice = true; 
	   }
   }
   if(radio_choice==false){
   		alert("Please select prefered method of payment transfer")
   		return false
   }
    if (form.lev1[0].checked){
		//AUTOMATIC TRANSFER
			radio_lev2_choice=false;
		
			for (counter = 0;  counter <4; counter++)
		   {
			 if (form.lev2[counter].checked){
			   radio_lev2_choice = true; 
			   }		
		   }
		   
		    if(radio_lev2_choice==false){
				alert("Please select duration when do you want to do the automatic transfer")
				return false
		   }
	
	}
	
	if (form.lev1[1].checked){
		//CHECK
			radio_lev2_choice=false;
		
			for (counter = 4;  counter <form.lev2.length; counter++)
		   {
			 if (form.lev2[counter].checked){
			   radio_lev2_choice = true; 
			   }		
		   }
		   
		    if(radio_lev2_choice==false){
				alert("Please select how do you want to collect the payment through check")
				return false
		   }
		   if(form.lev2[form.lev2.length-1].checked){
			   radio_lev3_choice=false;
			   
			   for (counter = 0;  counter <form.lev3.length; counter++)
			   {
				 if (form.lev3[counter].checked){
				   radio_lev3_choice = true; 
				   }		
			   }
			   
			   	 if(radio_lev3_choice==false){
					alert("Please select duration when do you want to mail the check")
					return false
			   }
			}
	}
   
   /*
   for (counter = 0;  counter <form.lev1.length; counter++)
   {
      if (form.lev1[counter].checked)
       radio_choice = true; 
	   }
   if(radio_choice==false)
   {
       alert("Please select your preferred means of withdrawing payments");
	   form.lev1[0].focus();
	   return false
	 }
radio_choice=false;
for (counter = 0;  counter <form.lev2.length; counter++)
   {
      if (form.lev2[counter].checked)
       radio_choice = true; 
	   }
   if(radio_choice==false)
   {
       alert("Please select your preferred means of withdrawing payments");
	   form.lev2[0].focus();
	   return false
	 }

if(form.lev2[5].value==checked)
{	 
radio_choice=false;
for (counter = 0;  counter <form.lev3.length; counter++)
   {
      if (form.lev3[counter].checked)
       radio_choice = true; 
	   }
   if(radio_choice==false)
   {
       alert("Please select your preferred means of withdrawing payments");
	   form.lev3[0].focus();
	   return false
	 }
} */	 	 	 	 
} 

//////////
function validate_proxy_request(regform)
{
		
	 if(trim(regform.name.value)=="")
	 {
	 	alert("Please Enter Name")
		regform.name.focus();
		return false
	 }
	 
	 if(trim(regform.email_address.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email_address.focus();
		return false
    }
	 else
	{
		st=regform.email_address.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email_address.focus();
			return false
		}
	}
	
	 if(regform.phone_number.value=="")
	 {
		alert("Please Enter Phone ")
		regform.phone_number.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.phone_number.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone_number.focus();
			return false
		}
	 }
	 
	 if(regform.phone_number_alt.value=="")
	 {
		alert("Please Enter Phone ")
		regform.phone_number_alt.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.phone_number_alt.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone_number_alt.focus();
			return false
		}
	 }
	
	
	
	if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter User Id")
		regform.userid.focus();
		return false
	 }
	 
	 if(trim(regform.url.value)=="")
	 {
		alert("Please Enter Url")
		regform.url.focus();
		return false
	 }

	 if(trim(regform.item_nummber.value)=="")
	 {
		alert("Please Enter Item Number")
		regform.item_nummber.focus();
		return false
	 }
		
	
  	 return true;
}
/////////////////

//////////
function submit_validate_authentication(regform)
{
	
	 if(trim(regform.contact_name.value)=="")
	 {
	 	alert("Please Enter Name")
		regform.contact_name.focus();
		return false
	 }
	 if(trim(regform.company_name.value)=="")
	 {
		alert("Please Enter Company Name")
		regform.company_name.focus();
		return false
	 }
	if(trim(regform.postal_address.value)=="")
	 {
		alert("Please Enter Address")
		regform.postal_address.focus();
		return false
	 }
	if(trim(regform.store_office_location.value)=="")
	 {
		alert("Please Enter Office Location")
		regform.store_office_location.focus();
		return false
	 }
	
	 if(regform.off_phone_number.value=="")
	 {
		alert("Please Enter Phone ")
		regform.off_phone_number.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.off_phone_number.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.off_phone_number.focus();
			return false
		}
	 }
	 
	  if(regform.home_phone_number.value=="")
	 {
		alert("Please Enter Phone ")
		regform.home_phone_number.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.home_phone_number.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.home_phone_number.focus();
			return false
		}
	 }
	
	
	if(trim(regform.email_address.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email_address.focus();
		return false
    }
	 else
	{
		st=regform.email_address.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email_address.focus();
			return false
		}
	}
	
	if(trim(regform.date_birth.value)=="")
	 {
		alert("Please Enter Birth Date")
		regform.date_birth.focus();
		return false
	 }
	 
	 if(trim(regform.place_birth.value)=="")
	 {
		alert("Please Enter Birth Place")
		regform.place_birth.focus();
		return false
	 }
	 	 
	
	 if(trim(regform.home_town.value)=="")
	 {
		alert("Please Enter Home Town")
		regform.home_town.focus();
		return false
	 }
		
	var fxa=(trim(regform.driver_licence_number.value)=="")?false:true;
	var fxb=(trim(regform.passport_number.value)=="")?false:true;
	var fxc=(trim(regform.voter_card_number.value)=="")?false:true;	
	 if((fxa && fxb) || (fxb && fxc) || (fxc && fxa))
	 {
		
		
		
	 }else{
	  	alert("Please Any Two Drivers license number or Passport number or Voters registration card number  ")
		regform.driver_licence_number.focus();
		return false
	 }
	 
	  if(regform.terms.checked==false)
	  {
	 	alert("For Authentication You have to Accept Our Terms & Conditions")
		return false
	 }  
	 
	 
  	 return true;
}
/////////////////
function shipadd(form)
{
	alert(form.lev2[5].checked);
	if(document.getElementById("lev2")[5].checked){
		document.getElementById('l3').style.display="";
		document.getElementById('l3').style.visibility='visible';
	}else{
	    document.getElementById('l3').style.display='none';
		document.getElementById('l3').style.visibility='hidden';	
	}
		
}
//////////////
function validateformrequest(s)
{
	if(eval(s.amount.value)>eval(s.amt.value))
	{
	alert("Max amount available to withdraw is "+s.amt.value)
	s.amount.value=s.amt.value
	return false
	}
	if(trim(s.subject.value)=="")
	{
	alert ("Please Provide Subject");
	s.subject.focus();
	return false
	}
	if(trim(s.mssg.value)=="")
	{
	alert ("Please Provide Message To Seller");
	s.mssg.focus();
	return false
	}

}

function soldlisting(form)
{
 if(trim(form.message.value)=="")
	    {
		alert ("Please Provide Message To Seller");
		form.message.focus();
		return false
	    }
}
/*function shippinfinfo(form)
{
	if(trim(form.message.value)=="")
	{
		alert ("Please Provide Message To Buyer");
		form.message.focus();
		return false
	}
	if(trim(form.trackurl.value)=="")
	{
		alert ("Please Provide Shipping Track URL");
		form.trackurl.focus();
		return false
	}
	return false;
}*/

function validaterequestform(s){
		
		
		if(eval(s.amount.value)>eval(s.amt.value)){
			alert("Max amount available to withdraw is "+s.amt.value)
			s.amount.value=s.amt.value
			return false
		}
		if(trim(s.message1.value)=="")
		{
		alert("please Povide Message To Admin");
		s.message1.focus();
		return false
		}
		
		
}
function clear1(s)
{
	//alert(sat)
	 s.value="";
  //document.getElementById("to_date").valiue=NULL;
}
function opendepositesummary(url){

		/*
		shilpa
		day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=900,height=600');");
		swathi
		JavaScript:MM_openBrWindow_scroll('','s','width=800,height=500,top=150,left=100,resizable=1')
		*/
	width=window.screen.width
	height=window.screen.height
	width=width-100
	height=height-100
	
	
	
	
	MM_openBrWindow_scroll(url,'s','width='+width+',height='+height+',top=50,left=50,scrollbars=1,resizable=1')
}

function wishconfirm(s1)
{
	s=confirm("Do You Really Want To Delete Your Photos?")
	//alert(s)
		if (s){
		
	           location.href="user_task.php?work=deletephoto&id="+s1;
         }
        
}
function validate_exchnage(s){
	if(trim(s.exchanage_rate.value)==""){
		alert("Please specify exchange rate")
		return false
	}
	//alert(isNaN(trim(s.exchanage_rate.value)))
	
	if(isNaN(trim(s.exchanage_rate.value))){
		alert("Please specify numeric values only")
		return false
	}
}
function isNumberFloat(inputString)
{
  return (!isNaN(parseFloat(inputString))) ? true : false;
}

function submit_validate_estore(regform)
{
		
	flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First your Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 }
	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Address")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {
	 	if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state2.focus();
		 	alert("Please Enter State Name")			
		}
		if(document.getElementById("state2").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state.focus();
		 	alert("Please Select State Name")			
		}
		if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("state2").style.display=='none'){
			regform.state1.focus();		
		 	alert("Please Select State Name")	
		}
		return false
	 }
	if(trim(regform.email.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	 else
	{
		st=regform.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email.focus();
			return false
		}
	}
	if(trim(regform.day.value)=="")
	 {
		alert("Please Select Day")
		regform.day.focus();
		return false
	 }
	 if(trim(regform.month.value)=="")
	 {
		alert("Please Select Month")
		regform.month.focus();
		return false
	 }
	 if(trim(regform.year.value)=="")
	 {
		alert("Please Select year")
		regform.year.focus();
		return false
	 }
	if(a2<18)
	{
		alert("Sorry, You are Under-aged, you cannot proceed further");
		regform.day.focus();
		return false; 
	}
	else
	{
		regform.age.value=a2
	}
	 if(regform.phone1.value=="")
	 {
		alert("Please Enter Phone")
		regform.phone1.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.phone1.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone1.focus();
			return false
		}
	 }
	 if (checkNum(regform.phone2.value)!=true)
	{
		alert("Please Enter Valid Phone No.")
		regform.phone2.focus();
		return false
	}
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	 if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter User ID")
		regform.userid.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.userid.value;
		if (s.length<6)
		{
			alert("User ID should have min. '6' characters")
			regform.userid.focus();
			return false
		}
		if(s.match(" "))
		{
			alert("User ID should not have spaces")
			regform.userid.focus();
			return false; 
		}
		
		var re = /^[A-Za-z]\w{6,}$/;
		
		if (!re.test(regform.userid.value)) { alert("Please enter a valid User ID"); regform.userid.focus(); return false}
	 }
	 if(trim(regform.password.value)=="")
	 {
		alert("Please Enter Password")
		regform.password.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.password.value;
		if (s.length<6)
		{
			alert("Password should have min. '6' characters")
			regform.password.focus();
			return false
		}
		/*var re = /^[A-Za-z]\w{6,}$/;
		
		if (!re.test(regform.password.value)) { alert("Please enter a valid Password"); regform.password.focus(); return false} */
	 }
	if(trim(regform.confirmpassword.value)=="")
	 {
		alert("Please Confirm Password")
		regform.confirmpassword.focus();
		return false
	 }
	if(regform.password.value != regform.confirmpassword.value)
	 {
		alert("Password and Confirm Password are not Same")
		regform.confirmpassword.focus();
		return false
	 }
    if(trim(regform.s_answer.value)=="")
	 {
		alert("Please Enter Answer for Secret Question")
		regform.s_answer.focus();
		return false
	 }
	if(regform.terms.checked==false)
	{
	 	alert("To Register You have to Accept Our Terms & Conditions")
		return false
	}
	 if(trim(regform.userdigit.value)=="")
	 {
		alert("Please Enter security Number")
		regform.userdigit.focus();
		return false
	 }
	/*if(trim(regform.company_name.value)=="")
	{
		 alert ("Please Enter Company name");
		 regform.company_name.focus();
		 return false;
	}
	if(trim(regform.cctype.value)=="")
	{
		 alert ("Please Select Card type");
		 regform.cctype.focus();
		 return false;
	}
	if(trim(regform.card_name.value)=="")
	{
		 alert ("Please Enter Card name");
		 regform.card_name.focus();
		 return false;
	}
	if(trim(regform.card_num.value)=="")
	{
		 alert ("Please Enter Card number");
		 regform.card_num.focus();
		 return false;
	}
	if(isNaN(regform.card_num.value))
	{
		 alert ("Please Enter correct value");
		 regform.card_num.focus();
		 return false;
	}
	if(checkCreditCard(regform.card_num.value))
	{
		alert("Enter a Valid Credit Card Number (without any spaces)")
		regform.card_num.value=""
		regform.card_num.focus()
		return false;
	}
	if(trim(regform.c_address.value)=="")
	{
		 alert ("Please Enter Address");
		 regform.c_address.focus();
		 return false;
	}
	var exp_dt = regform.exp_year.value+""+regform.exp_month.value;
	var exp_yr = regform.ydate.value;
	if(exp_yr >= exp_dt)
	{
		alert("Card Expiry date is less than Today");
		return false;
	}*/
  	 
}

function validate_listingcenter(s1){
	if(trim(s1.nm.value)==""){
		alert("please enter name")
		s1.nm.focus()
		return false
	}
	if(trim(s1.addr.value)==""){
		alert("please enter address")
		s1.addr.focus()
		return false
	}
	if(trim(s1.city.value)==""){
		alert("please enter city")
		s1.city.focus()
		return false
	}
	if(s1.reg.value==""){
		alert("please enter Region.")
		s1.reg.focus()
		return false
	}
	if(trim(s1.email_id.value)==""){
		alert("please enter emailid")
		s1.email_id.focus()
		return false
	}else{
					st=s1.email_id.value;
					if(validEmailCheck(st)==false)
					{
						alert("Please Enter Correct Email")
						s1.email_id.focus();
						return false
					}
	}
	if(allDigits(s1.hop.value)== false){
		alert("Please enter Hours in numeric.")
		s1.hop.focus()
		return false
	}

}
//validation for email by Megha On 28-May-2010
function validEmailCheck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		      return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		  
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		   
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){		    
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		  
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){		  
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){		   
		    return false
		 }

 		 return true					
	}
 //End validation for mail by Megha

//function validate() Modified by Blesy on 04/02/2009
function validate55(g)
{		
	//var g=window.document.forms[0];
	if(g)
	{
		//if(g.product_name.value=="")
		if(add_prod.product_name.value=="")
		{
			alert("Enter Product Name");
			add_prod.product_name.focus();
			return false;
		}
		if(add_prod.textdesc.value=="")
		{
			alert("Enter Product Description");
			return false;
		}
		if(add_prod.textship.value=="")
		{
			alert("Enter Shipping Description");
			add_prod.textship.focus();
			return false;
		}
	}
}

function validate_buyeriwant(g)
{
	if(g)
	{
		if(g.product_name.value=="")
		{
			alert("Enter Product Name");
			add_prod.product_name.focus();
			return false;
		}
		/*if(g.textdesc.value=="")
		{
			alert("Enter Product Description");
			return false;
		}	*/
		if((g.imagename1.value=="") && (g.imagename2.value=="") && (g.imagename3.value=="") && (g.imagename4.value==""))
		{
			alert("Upload Image File");
			g.imagename1.focus();
			return false;
		}
		if((g.mkdef[0].checked==false) && (g.mkdef[1].checked==false) && (g.mkdef[2].checked==false) && (g.mkdef[3].checked==false))
		{
			alert("Select The Default Image");
			g.mkdef[0].focus();
			return false;
		}
	}
}
function validate_reverse(form,usertype)
{
	if(form.login.value == "")
	{
		alert("Please Login before you participate in the bidding");
		location.href = "signin.php";
		return false;
	}
	if(usertype=='Buyer')
	{
		alert("Only seller can participate in Bidding");
		return false;
	}
	if(form.planre.value=='1')//comment removed by Megha
	{	
		alert("Please Setup The Plan Before Bidding");
		location.href = "seller/package_renew.php";
		return false;
	}
	if(form.login.value!= "")
		{
			if(form.login.value == form.user.value)
			{
				alert(" Same seller cannot participate in the Bidding");
				return false;
			}	
		}
		if(document.getElementById("payset").value == "true" && document.getElementById("payset").value != "")
		{
			alert("Please Setup The Payment Settings Before Bidding");
			window.location = document.getElementById("allowbidpath").value
			return false;
		}
		if(document.getElementById("shipset").value == "true" && document.getElementById("shipset").value != "")
		{
			alert("Please Setup The Shipping Methods Before Bidding")
			window.location = document.getElementById("allowbidpath").value
			return false;
		}
		//Added by Blesy on 29/01/2009
		if(document.getElementById("amount").value == "true" && document.getElementById("amount").value != "")
		{
			var MinDPAmount =parseFloat(document.getElementById("depamount").value);
					MinDPAmount = MinDPAmount.toFixed(2);

	//		alert("Sorry You Dont Have Enough Money In Deposit Account, Please Contact To Admin Before "+page + ".")
			alert("You should have Minimum Deposit : "+ MinDPAmount + " cedies to bid this product, Please Deposit Amount.")
			window.location="http://www.ghanaauction.com/credit_acc.php?type=deposit";

			return false;
		}
	if(form.ship_courier.value == '') //For ship Courier
		{
		alert("Please select shipping courier.");
		form.ship_courier.focus();
		return false;
		}
if(form.bid_amt.value == "" || form.bid_amt.value <= 0)
		{
			alert("Enter the Bid amount more than 0");
			form.bid_amt.focus();
			return false;
		}
		if(form.bid_amt.value != "")
		{
			if (checkFloat(form.bid_amt.value)!=true)
			{
				alert("Enter a valid Bid amount");
				form.bid_amt.focus();
				return false;
			}
		}
		if(form.numrec.value!='0')
		{
			if(confirm("\t!!W A R N I N G!!\n\n You have been already participated in the bidding.\t\n\n Do you wish to continue?\t\n\n"))
			{
				return true;
			}
			return false;
		}
	
	return true;
}

function validate_editshipping(frm)
{
	if(frm.from.value == "")
	{
		alert("Enter the Price From value")	
		frm.from.focus()
		return false;
	}
	if(!(parseFloat(frm.from.value)))
	{
		alert("Value should be numeric")
		frm.from.value = ""
		frm.from.focus()
		return false;
	}
	if(frm.to.value == "")
	{
		alert("Enter the Price To value")	
		frm.to.focus()
		return false;
	}
	if(!(parseFloat(frm.to.value)))
	{
		alert("Value should be numeric")
		frm.to.value = ""
		frm.to.focus()
		return false;
	}
	if(frm.first.value == "")
	{
		alert("Enter the Price for First Item")	
		frm.first.focus()
		return false;
	}
	if(!(parseFloat(frm.first.value)))
	{
		alert("Value should be numeric")
		frm.first.value = ""
		frm.first.focus()
		return false;
	}
	if(frm.add.value == "")
	{
		alert("Enter the Price for Additional Item")	
		frm.add.focus()
		return false;
	}
	if(!(parseFloat(frm.add.value)))
	{
		alert("Value should be numeric")
		frm.add.value = ""
		frm.add.focus()
		return false;
	}
}

function function_search(){
	if(trim(document.frm.sear.value)=="")
	{
		alert("Please enter search text")
		document.frm.sear.focus();
		return false
	} else 
	{
	document.frm.action		=	document.frm.action + "?search="+encodeURIComponent(document.frm.sear.value);
	return true;
	}
}
function validate_payment ()
{
	var checked = false;
	var buttons = frm1.btn;   
	var temp;   // for storing the index value
	//alert(buttons)
	lens=buttons.length
	value1=""
	if (buttons==null)
		return false
	//alert(lens)
	if (lens>1) {
		for (var i=0; i<buttons.length; i++)
		{      
			if (buttons[i].checked) 
			{ 
			   checked = true; 
			   value1=buttons[i].value
			   temp = i;
			   
			   /////////////////// filed validation code //////////////////////
			   
			   if(buttons[temp].value == "Authorize")
		{
			if(frm1.owner0.value == "")
			{
				alert("Enter the Name")
				frm1.owner0.focus()
				return false;
			}
			else if(frm1.number0.value == "")
			{
				alert("Enter the Credit Card Number")
				frm1.number0.focus()
				return false;
			}
			else if(!(checkCreditCard(frm1.number0.value)))
			{
				alert("Enter a Valid Credit Card Number (without any spaces)")
				frm1.number0.value =""
				frm1.number0.focus()
				return false;
			}
			if(dropdown_validator(frm1.authorizenet_cc_expires_month0.value,frm1.authorizenet_cc_expires_year0.value) == false)
			{
				return false;
			}
		}
		else if(buttons[temp].value == "Cash On Delivery")
		{
		}
		else if(buttons[temp].value == "Check / Money Order")
		{
		}
		else if(buttons[temp].value == "Direct Deposit")
		{
		}
		else if(buttons[temp].value == "2Checkout")
		{
			if(frm1.fname4.value == "")
			{
				alert("Enter the First Name")
				frm1.fname4.focus()
				return false;
			}
			else if(frm1.lname4.value == "")
			{
				alert("Enter the Last Name")	
				frm1.lname4.focus()
				return false;
			}
			else if(frm1.number4.value == "")
			{
				alert("Enter the Credit Card Number")
				frm1.number4.focus()
				return false;
			}
			else if(frm1.check4.value == "")
			{
				alert("Enter the Credit Card Check number")
				frm1.check4.focus()
				return false;
			}
			else if(!(checkCreditCard(frm1.number4.value)))
			{
				alert("Enter a Valid Credit Card Number (without any spaces)")
				frm1.number4.value =""
				frm1.number4.focus()
				return false;
			}
			if(dropdown_validator(frm1.authorizenet_cc_expires_month4.value,frm1.authorizenet_cc_expires_year4.value) == false)
			{
				return false;
			}
		}
		else if(buttons[temp].value == "Secpay")
		{
		}
		else if(buttons[temp].value == "ipayment")
		{
			if(frm1.owner6.value == "")
			{
				alert("Enter the Name")
				frm1.owner6.focus()
				return false;
			}
			else if(frm1.number6.value == "")
			{
				alert("Enter the Credit Card Number")
				frm1.number6.focus()
				return false;
			}
			else if(frm1.check6.value == "")
			{
				alert("Enter the Credit Card Check number")
				frm1.check6.focus()
				return false;
			}
			else if(!(checkCreditCard(frm1.number6.value)))
			{
				alert("Enter a Valid Credit Card Number (without any spaces)")
				frm1.number6.value =""
				frm1.number6.focus()
				return false;
			}
			else if(dropdown_validator(frm1.authorizenet_cc_expires_month6.value,frm1.authorizenet_cc_expires_year6.value) == false)
			{
				return false;
			}
		}
		else if(buttons[temp].value == "psigate")
		{
			if(frm1.owner7.value == "")
			{
				alert("Enter the Name")
				frm1.owner7.focus()
				return false;
			}
			else if(frm1.number7.value == "")
			{
				alert("Enter the Credit Card Number")
				frm1.number7.focus()
				return false;
			}
			else if(!(checkCreditCard(frm1.number7.value)))
			{
				alert("Enter a Valid Credit Card Number (without any spaces)")
				frm1.number7.value =""
				frm1.number7.focus()
				return false;
			}
			else if(dropdown_validator(frm1.authorizenet_cc_expires_month7.value,frm1.authorizenet_cc_expires_year7.value) == false)
			{
				return false;
			}
		}
		else if(buttons[temp].value == "Worldpay")
		{
		}
		else if(buttons[temp].value == "Paypal")
		{
		}
		
			   ////////////////// field validation code ending....////////////////////
			}     
		}   
	} else {
		//alert(buttons.checked)
		//return false
		if (buttons.checked) 
		{ 
		   checked = true;  
		   value1=buttons.value
		   //temp = i;
		   //////////////////////////////////////////// field validation code not control array//////////////////////////
		   
		   
		   if(buttons.value == "Authorize")
			{
				if(frm1.owner0.value == "")
				{
					alert("Enter the Name")
					frm1.owner0.focus()
					return false;
				}
				else if(frm1.number0.value == "")
				{
					alert("Enter the Credit Card Number")
					frm1.number0.focus()
					return false;
				}
				else if(!(checkCreditCard(frm1.number0.value)))
				{
					alert("Enter a Valid Credit Card Number (without any spaces)")
					frm1.number0.value =""
					frm1.number0.focus()
					return false;
				}
				if(dropdown_validator(frm1.authorizenet_cc_expires_month0.value,frm1.authorizenet_cc_expires_year0.value) == false)
				{
					return false;
				}
			}
			else if(buttons.value == "Cash On Delivery")
			{
			}
			else if(buttons.value == "Check / Money Order")
			{
			}
			else if(buttons.value == "Direct Deposit")
			{
			}
			else if(buttons.value == "2Checkout")
			{
				if(frm1.fname4.value == "")
				{
					alert("Enter the First Name")
					frm1.fname4.focus()
					return false;
				}
				else if(frm1.lname4.value == "")
				{
					alert("Enter the Last Name")	
					frm1.lname4.focus()
					return false;
				}
				else if(frm1.number4.value == "")
				{
					alert("Enter the Credit Card Number")
					frm1.number4.focus()
					return false;
				}
				else if(frm1.check4.value == "")
				{
					alert("Enter the Credit Card Check number")
					frm1.check4.focus()
					return false;
				}
				else if(!(checkCreditCard(frm1.number4.value)))
				{
					alert("Enter a Valid Credit Card Number (without any spaces)")
					frm1.number4.value =""
					frm1.number4.focus()
					return false;
				}
				if(dropdown_validator(frm1.authorizenet_cc_expires_month4.value,frm1.authorizenet_cc_expires_year4.value) == false)
				{
					return false;
				}
			}
			else if(buttons.value == "Secpay")
			{
			}
			else if(buttons.value == "ipayment")
			{
				if(frm1.owner6.value == "")
				{
					alert("Enter the Name")
					frm1.owner6.focus()
					return false;
				}
				else if(frm1.number6.value == "")
				{
					alert("Enter the Credit Card Number")
					frm1.number6.focus()
					return false;
				}
				else if(frm1.check6.value == "")
				{
					alert("Enter the Credit Card Check number")
					frm1.check6.focus()
					return false;
				}
				else if(!(checkCreditCard(frm1.number6.value)))
				{
					alert("Enter a Valid Credit Card Number (without any spaces)")
					frm1.number6.value =""
					frm1.number6.focus()
					return false;
				}
				else if(dropdown_validator(frm1.authorizenet_cc_expires_month6.value,frm1.authorizenet_cc_expires_year6.value) == false)
				{
					return false;
				}
			}
			else if(buttons.value == "psigate")
			{
				if(frm1.owner7.value == "")
				{
					alert("Enter the Name")
					frm1.owner7.focus()
					return false;
				}
				else if(frm1.number7.value == "")
				{
					alert("Enter the Credit Card Number")
					frm1.number7.focus()
					return false;
				}
				else if(!(checkCreditCard(frm1.number7.value)))
				{
					alert("Enter a Valid Credit Card Number (without any spaces)")
					frm1.number7.value =""
					frm1.number7.focus()
					return false;
				}
				else if(dropdown_validator(frm1.authorizenet_cc_expires_month7.value,frm1.authorizenet_cc_expires_year7.value) == false)
				{
					return false;
				}
			}
			else if(buttons.value == "Worldpay")
			{
			}
			else if(buttons.value == "Paypal")
			{
			}
		   
		   ///////////////////////////////////////////// field validation code not control array ending//////////////
		} 
	}
	if(!checked)
	{
		alert("Choose a Payment Method (Radio Button)");     
		return false;
	}
	else if(checked == true)
	{
		frm1.pay.value=value1;
	}
	//location.href = "final_checkout.php?inv="+frm1.inv.value+"&paytype="+buttons[temp].value
	return true;
}

function adm_banner_validate(s1)
{
	if (trim(s1.seller_logo.value)=="")
	{
		alert("Upload banner image.....")
		return false
	}
	/*if (trim(s1.cat_name2.value)==""){ //This if commented By Megha on 14-July-2010
		alert("Please enter link URL with http://www.")
		s1.cat_name2.focus()
		return false
	} else {*/
if (trim(s1.cat_name2.value) !=""){ //This if added By Megha on 14-July-2010
		if(!checkURL(s1.cat_name2.value)){
			alert("Please enter valid link URL.");
			s1.cat_name2.focus()
			return false
		}
	}
	if (document.reg.btype.value== 0)
	{
		alert("Please select banner size.")
		return false
	}
}
function adm_banner_user(s1){
	/*if (trim(s1.seller_logo.value)==""){
		alert("Upload banner image")
		return false
	} 	
	if (trim(s1.cat_name2.value)==""){
		alert("Please enter link URL with http://")
		s1.cat_name2.focus()
		return false
	} 
	*/
}


function store_search(s1)
{
	alert(satish)
	if (trim(s1.search1.value)=="")
	{
		alert("Plese enter a keyword")
		return false
	}
}
function allDigits(str)
{
	return inValidCharSet(str,"0123456789");
}
function allDigitsWithPoint(str)//By Megha on 03-June-2010
{
	return inValidCharSet(str,"0123456789.");
}
function inValidCharSet(str,charset)
{
	var result = true;
	for (var i=0;i<str.length;i++)
		if (charset.indexOf(str.substr(i,1))<0)
		{
			result = false;
			break;
		}
	
	return result;
}
function MM_openBrWindow_mail(theURL,winName,features){
  features=features;
  window.open(theURL,winName,features);
}

function MM_openBrWindow_scroll_new(theURL,winName,features)//v2.0 //Added by Blesy on 02/02/2009
{  
	if(features=="")
	{
		var centerWidth = (window.screen.width - 850) / 2;
		var centerHeight = (window.screen.height - 650) / 2;
		var features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=850,height=550,left='+centerWidth+',top='+centerHeight;
	} 
	window.open(theURL,winName,features);
}

function MM_openGiftProUpdate(theURL,winName,features)//v2.0 //Added by Blesy on 02/02/2009
{  
	if(features=="")
	{
		var centerWidth = (window.screen.width - 850) / 2;
		var centerHeight = (window.screen.height - 650) / 2;
		var features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=400,left='+centerWidth+',top='+centerHeight;
	} 
	window.open(theURL,winName,features);
}

function MM_openBrWindow_scroll(theURL,winName,features) { //v2.0

	if(features==""){
		var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
	  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=700,left='+centerWidth+',top='+centerHeight;
	 } 
  window.open(theURL,winName,features);
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
	var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=242,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_banner(theURL,winName,features) { //v2.0
	var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2 - 120;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=no,width=550,height=600,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_h(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=103,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_01(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=291,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_02(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=621,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_03(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=621,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}


function MM_openBrWindow_big(theURL,winName,features) { //v2.0
	//alert(theURL);
	var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=600,height=621,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_mid(theURL,winName,features) { //v2.0
	/*var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;*/
	var centerWidth = (window.screen.width - 850) / 2;
	var centerHeight = (window.screen.height - 650) / 2;

  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=850,height=580,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_ProIns(theURL,winName,features) { //v2.0
	/*var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;*/
	var centerWidth = (window.screen.width - 850) / 2;
	var centerHeight = (window.screen.height - 650) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=300,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_04(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=103,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_05(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=138,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_06(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=75,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_07(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=105,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_08(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=50,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_09(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=120,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_10(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=50,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_11(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=140,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_12(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=100,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_13(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=450,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_14(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=120,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_15(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=50,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_200(theURL,winName,features) { //v2.0
	var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=170,left=200,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
  
}
function MM_closeBrWindow_200(theURL,winName,features)
{
	window.close(theURL,winName,features);
}
function MM_openBrWindow_16(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=245,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_17(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=245,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_18(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=155,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_19(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=50,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_300(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=280,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_20(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=345,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_21(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=105,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_22(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=105,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
function MM_openBrWindow_23(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=500,height=400,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}

function MM_openBrWindow_24(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=700,height=550,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}

function MM_openBrWindow_25(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=700,height=460,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}

function MM_openBrWindow_26(theURL,winName,features) { //v2.0
var centerWidth = (window.screen.width - 500) / 2;
    var centerHeight = (window.screen.height - 500) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=800,height=621,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
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_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 LTrim(str)
{
   var whitespace = new String("\t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      // We have a string with leading blank(s)...

      var j=0, i = s.length;

      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str)
{
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...
     var i = s.length - 1;       // Get length of string
      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }

   return s;
}


function trim(str)
{
   return RTrim(LTrim(str));
}

function checkEmail(str)
	{
		if((str.indexOf("@")==-1) || (str.indexOf(".")==-1))
		{
			fstr="Please Enter @ or .";
			return false;
		}
		else
		{
		if((str.indexOf("@") == 0) || (str.indexOf(".") == 0))
		{
			fstr="@ or . Cannot Be first";
			return false;
		}
		if((str.indexOf("@") == (str.length-1)) || (str.indexOf(".") == (str.length-1)))
		{
			fstr="@ or . Cannot Be Last";
			return false;
		}

		/*if(str.indexOf("@") > str.indexOf("."))
		{
			fstr="@ Should be After .";
			return false;
		}*/
		if((str.indexOf("@")+1) == str.indexOf("."))
		{
			fstr="@. IS Invalid Email";
			return false;
		}
		}
		var cp=0;					
	
		if(cp==2)
		{
			fstr="@ cannnot be repeated";
			return false;
		}
		return true;
	}

function EmailCheck(myForm)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(trim(myForm))) 
	{
		return true;
	}		
	return false 
}
function checkNum(str) {

				 for(i=0;i<str.length;i++) { 

					 c=str.charAt(i);

					  b=(((c >= "0") && (c <= "9")) || (c==" ") || (c=="(")|| (c==")")|| (c=="-") ) 

					  if(b==true) 

					  continue; 

					  else 

					  return false; 

				  } 

				  return true; 

			  }

function UNIXday(D) {
  return Date.UTC(D[0], D[1]-1, D[2])/864e5 
  }
  function ValidDate(y, m, d) { // m = 0..11 ; y m d integers, y!=0
  with (new Date(y, m, d))
    return (getMonth()==m && getDate()==d) /* was y, m */ }
function ReadISO8601date(Q) { var T // adaptable for other layouts
  if ((T = /^(\d+)([-\/])(\d\d)(\2)(\d\d)$/.exec(Q)) == null)
    { return -2 } // bad format
  for (var j=1; j<=5; j+=2) T[j] = +T[j] // some use needs numbers
  if (!ValidDate(T[1], T[3]-1, T[5])) { return -1 } // bad value
  return [ T[1], T[3], T[5] ] }
  
function DiffYD(S1, S2) {


  var D1 = ReadISO8601date(S1) ; 
  var D2 = ReadISO8601date(S2) ; 
  var DY = D1[0]-D2[0]
  //alert("in here")
  if ( (D1[1]<D2[1]) || ( (D1[1]==D2[1]) && (D1[2]<D2[2] ) ) ) 
  		DY--
  D2[0] += DY
  return [ DY ] 
  }
//////////////////////////////// all buyer panel functions///////////////////////////////
/// function to upgrade Seller...
function upgrade_seller(s)
{
 var g=s;
 if(trim(g.company_name.value)=="")
 {
	 alert ("Please enter Company name");
	 g.company_name.focus();
	 return false;
 }
 
  if(trim(g.phoneno.value)=="")
 {
	 alert ("Please enter Phone No");
	 g.phoneno.focus();
	 return false;
 }
 
       if(document.g.phoneno.value!="")
		{
			if(!checkNum(document.g.phoneno.value))
			{
				alert("Enter Valid Phone No.");				
				document.g.phoneno.focus();
				return false;
			}
		}
 /*if(trim(g.cctype.value)=="")
 {
	 alert ("Please Select card type");
	 g.cctype.focus();
	 return false;
 }
  if(trim(g.card_name.value)=="")
 {
	 alert ("Please enter Card name");
	 g.card_name.focus();
	 return false;
 }
 if(trim(g.card_num.value)=="")
 {
	 alert ("Please enter Card number");
	 g.card_num.focus();
	 return false;
 }

 if(isNaN(g.card_num.value))
 {
	 alert ("Please enter correct value");
	 g.card_num.focus();
	 return false;
 }
 if(checkCreditCard(g.card_num.value))
			{
				alert("Enter a Valid Credit Card Number (without any spaces)")
				g.card_num.value=""
				g.card_num.focus()
				return false;
			}
 if(trim(g.address.value)=="")
 {
	 alert ("Please enter Address");
	 g.address.focus();
	 return false;
 }
	var exp_dt=g.exp_year.value+""+g.exp_month.value;
	var exp_yr=g.ydate.value;
	if(exp_yr>=exp_dt)
	{
	alert("Card Expiry date is less than Today");
	return false;
	}*/
}
/// function to upgrade Music Seller...
function upgrade_music_seller(s)
{
	 var g=s;
	 if(trim(g.id_proof.value)=="")
	 {
		 alert ("Please enter Identity Proof");
		 g.id_proof.focus();
		 return false;
	 }
	 if(trim(g.company_name.value)=="")
	 {
		 alert ("Please enter Company name");
		 g.company_name.focus();
		 return false;
	 }

	if(g.phoneno.value!="")
	{
		 if (checkNum(g.phoneno.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			g.phoneno.focus();
			return false
		}
	}

	  if(g.chk_terms.checked==false)
	 {
		alert("Please accept our Terms & Agreement");
		g.chk_terms.focus();
		return false
	 }
		document.upgrade_form.btnsubmit.disabled=false;
		return true;

}

// Validate credit card info.

function dropdown_validator(mnth,yr)
{
	// Variables for the current date, year and month
	var right_now=new Date();
	var the_year=right_now.getYear();
	var the_month=right_now.getMonth();
	
	// Check for input in both the month and year fields
	if (mnth == "" || yr == "")
	{
		alert("Please select a month and year");
		return false;
	}
	// Check to see if the request is within the current year and month
	if (yr == the_year && mnth <= the_month)
	{
		alert("Please check the month of your request.");
		return (false);
	}
	// Check to see if the year request is calid
	if (yr < the_year)
	{
		alert("Please check the year of your request.");
		return (false);
	}
	else
		return true;
}

// Validate credit card info.

function checkCreditCard (x)
{   
	if(isCreditCard(x))
	return(isAnyCard(x))
}

function isCreditCard(st) {
  // Encoding only works on cards with less than 19 digits
  if (st.length > 19)
    return (false);

  sum = 0; mul = 1; l = st.length;
  for (i = 0; i < l; i++) {
    digit = st.substring(l-i-1,l-i);
    tproduct = parseInt(digit ,10)*mul;
    if (tproduct >= 10)
      sum += (tproduct % 10) + 1;
    else
      sum += tproduct;
    if (mul == 1)
      mul++;
    else
      mul--;
  }
// Uncomment the following line to help create credit card numbers
// 1. Create a dummy number with a 0 as the last digit
// 2. Examine the sum written out
// 3. Replace the last digit with the difference between the sum and
//    the next multiple of 10.

//  document.writeln("<BR>Sum      = ",sum,"<BR>");
//  alert("Sum      = " + sum);

  if ((sum % 10) == 0)
    return (true);
  else
    return (false);

} // END FUNCTION isCreditCard()



/*  ================================================================
    FUNCTION:  isVisa()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid VISA number.
		    
	      false, otherwise

    Sample number: 4111 1111 1111 1111 (16 digits)
    ================================================================ */

function isVisa(cc)
{
  if (((cc.length == 16) || (cc.length == 13)) &&
      (cc.substring(0,1) == 4))
    return isCreditCard(cc);
  return false;
}  // END FUNCTION isVisa()




/*  ================================================================
    FUNCTION:  isMasterCard()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid MasterCard
		    number.
		    
	      false, otherwise

    Sample number: 5500 0000 0000 0004 (16 digits)
    ================================================================ */

function isMasterCard(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 16) && (firstdig == 5) &&
      ((seconddig >= 1) && (seconddig <= 5)))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isMasterCard()





/*  ================================================================
    FUNCTION:  isAmericanExpress()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid American
		    Express number.
		    
	      false, otherwise

    Sample number: 340000000000009 (15 digits)
    ================================================================ */

function isAmericanExpress(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 15) && (firstdig == 3) &&
      ((seconddig == 4) || (seconddig == 7)))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isAmericanExpress()




/*  ================================================================
    FUNCTION:  isDinersClub()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Diner's
		    Club number.
		    
	      false, otherwise

    Sample number: 30000000000004 (14 digits)
    ================================================================ */

function isDinersClub(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 14) && (firstdig == 3) &&
      ((seconddig == 0) || (seconddig == 6) || (seconddig == 8)))
    return isCreditCard(cc);
  return false;
}



/*  ================================================================
    FUNCTION:  isCarteBlanche()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Carte
		    Blanche number.
		    
	      false, otherwise
    ================================================================ */

function isCarteBlanche(cc)
{
  return isDinersClub(cc);
}




/*  ================================================================
    FUNCTION:  isDiscover()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Discover
		    card number.
		    
	      false, otherwise

    Sample number: 6011000000000004 (16 digits)
    ================================================================ */

function isDiscover(cc)
{
  first4digs = cc.substring(0,4);
  if ((cc.length == 16) && (first4digs == "6011"))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isDiscover()





/*  ================================================================
    FUNCTION:  isEnRoute()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid enRoute
		    card number.
		    
	      false, otherwise

    Sample number: 201400000000009 (15 digits)
    ================================================================ */

function isEnRoute(cc)
{
  first4digs = cc.substring(0,4);
  if ((cc.length == 15) &&
      ((first4digs == "2014") ||
       (first4digs == "2149")))
    return isCreditCard(cc);
  return false;
}



/*  ================================================================
    FUNCTION:  isJCB()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid JCB
		    card number.
		    
	      false, otherwise
    ================================================================ */

function isJCB(cc)
{
  first4digs = cc.substring(0,4);
  if ((cc.length == 16) &&
      ((first4digs == "3088") ||
       (first4digs == "3096") ||
       (first4digs == "3112") ||
       (first4digs == "3158") ||
       (first4digs == "3337") ||
       (first4digs == "3528")))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isJCB()



/*  ================================================================
    FUNCTION:  isAnyCard()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is any valid credit
		    card number for any of the accepted card types.
		    
	      false, otherwise
    ================================================================ */

function isAnyCard(cc)
{
  if (!isCreditCard(cc))
    return false;
  if (!isMasterCard(cc) && !isVisa(cc) && !isAmericanExpress(cc) && !isDinersClub(cc) &&
      !isDiscover(cc) && !isEnRoute(cc) && !isJCB(cc)) {
    return false;
  }
  return true;

} // END FUNCTION isAnyCard()




function IsCC (st) {
    return isCreditCard(st);
}

function IsVisa (cc)  {
  return isVisa(cc);
}

function IsVISA (cc)  {
  return isVisa(cc);
}

function IsMasterCard (cc)  {
  return isMasterCard(cc);
}

function IsMastercard (cc)  {
  return isMasterCard(cc);
}

function IsMC (cc)  {
  return isMasterCard(cc);
}

function IsAmericanExpress (cc)  {
  return isAmericanExpress(cc);
}

function IsAmEx (cc)  {
  return isAmericanExpress(cc);
}

function IsDinersClub (cc)  {
  return isDinersClub(cc);
}

function IsDC (cc)  {
  return isDinersClub(cc);
}

function IsDiners (cc)  {
  return isDinersClub(cc);
}

function IsCarteBlanche (cc)  {
  return isCarteBlanche(cc);
}

function IsCB (cc)  {
  return isCarteBlanche(cc);
}

function IsDiscover (cc)  {
  return isDiscover(cc);
}

function IsEnRoute (cc)  {
  return isEnRoute(cc);
}

function IsenRoute (cc)  {
  return isEnRoute(cc);
}

function IsJCB (cc)  {
  return isJCB(cc);
}

function IsAnyCard(cc)  {
  return isAnyCard(cc);
}

function IsCardMatch (cardType, cardNumber)  {
  return isCardMatch (cardType, cardNumber);
}

				//// Deleting email..
/*function validate_b_inbox(k)
{
	flag="No"
	if(form1.Mid)
{
	i=form1.Mid.length
	if (i>1)
	{
		for(i1=0;i1<i;i1++)
		{
		 	if(form1.Mid[i1].checked)
			flag="yes"
		}
	}
	else
	{
		if(form1.Mid.checked)
		flag="yes"
	}
}
	if (flag=="yes")
	{
		form1.action='buyer/buyer_tasks1.php';
		form1.submit();
		return true;
	}
	else
	{
		alert("Select records to delete")
		return false
	}
}*/

function validate_b_inbox(k)
{
	flag="No"
	values="0"
	if(form1.Mid1)
	{
		i=form1.Mid1.length
		if (i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(form1.Mid1[i1].checked){
					flag="yes"
					values=values + "," + form1.Mid1[i1].value
				}
			}
		}
		else
		{
			if(form1.Mid1.checked) {
			flag="yes"
				values=values +"," + form1.Mid1.value
			}
		}
	}
	if (flag=="yes")
	{
		if (confirm('Do you really want to delete selected mail(s).') == true)
		{		
		form1.action='buyer/buyer_tasks1.php';
		form1.Mid.value=values;
		form1.submit();
		return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		alert("Please select records to delete.")
		return false
	}
}


// added by lalit
function delete_b_trash(k)
{
	flag="No"
	values="0"
	if(form1.Mid1)
	{
		i=form1.Mid1.length
		if (i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(form1.Mid1[i1].checked){
					flag="yes"
					values=values + "," + form1.Mid1[i1].value
				}
			}
		}
		else
		{
			if(form1.Mid1.checked) {
			flag="yes"
				values=values +"," + form1.Mid1.value
			}
		}
	}
	if (flag=="yes")
	{
		if (confirm('Do you really want to delete selected mail(s).') == true)
		{
		form1.action='buyer/deletetrash.php';
		form1.Mid.value=values;
		form1.submit();
		return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		alert("Please select records to delete.")
		return false
	}
}

function delete_s_trash(k)
{
	flag="No"
	values="0"
	if(form1.Mid1)
	{
		i=form1.Mid1.length
		if (i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(form1.Mid1[i1].checked){
					flag="yes"
					values=values + "," + form1.Mid1[i1].value
				}
			}
		}
		else
		{
			if(form1.Mid1.checked) {
			flag="yes"
				values=values +"," + form1.Mid1.value
			}
		}
	}
	if (flag=="yes")
	{
		if (confirm('Do you really want to delete selected mail(s).') == true)
		{
		form1.Mid.value=values;
		form1.action='deletetrash.php';
		form1.submit();
		return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		alert("Please select records to delete.")
		return false
	}
}
// deleting email over ..

//////////////////////////////// all buyer panel functions Ending///////////////////////////////

//////////////////////////////// all Seller panel functions ///////////////////////////////

function form_querystring(s)
{
	//alert(s);
	var g=window.document.forms[0];
	var oEditor = FCKeditorAPI.GetInstance('textdesc') ;
	
 	var Obj=document.add_prod;
 	var desc=oEditor.GetXHTML( true );
 	desc= desc.replace(/doublequot/g,"\"");
	Obj.preview_content1.value=desc;
	
	/* if(trim(g.textpay.value)=="")
 	 { 
		alert("Please Enter payment Details");

		g.textpay.focus();
		return false; 
	 }

	 if(trim(g.textship.value)=="")
 	 {
		alert("Please Enter Shipping Details");

		g.textship.focus();
		return false; 
	 }
	 	
	 if(trim(g.textwarranty.value)=="")
 	 {
		alert("Please Enter Warranty description");

		g.textwarranty.focus();
		return false; 
	 }  */

	 if(Obj.subtitle.value != "")

	 	subtitle = 1;
	else
		subtitle = 0	

		

	if(Obj.auctiontype.value == "estore")

		window.open("product_estore_preview.php?id="+s.id.value+"&image1="+s.imagename1.value+"&extra="+s.extra.value+"&flag="+s.flag.value+"&flag2="+s.flag2.value+"&bold="+s.bold1.value+"&border="+s.border1.value+"&highlight="+s.highlight1.value+"&subtitle="+subtitle+"&featuredprod="+s.featuredprod1.value,'Preview',"width=790,height=630,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no"); 
	else
		window.open("product_auction_preview.php?id="+s.id.value+"&image1="+s.imagename1.value+"&extra="+s.extra.value+"&flag="+s.flag.value+"&flag2="+s.flag2.value+"&bold="+s.bold1.value+"&border="+s.border1.value+"&highlight="+s.highlight1.value+"&subtitle="+subtitle+"&featuredprod="+s.featuredprod1.value,'Preview',"width=790,height=630,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no");

//window.open("auction_product_detail_display.php?p_id=41");
}

function prod_editpreview(s)
{
	var g=window.document.forms[0];
	var oEditor = FCKeditorAPI.GetInstance('textdesc') ;
	
 	var Obj=document.add_prod;
 	var desc=oEditor.GetXHTML( true );
 	desc= desc.replace(/doublequot/g,"\"");
	Obj.preview_content1.value=desc;
	
	 if(Obj.subtitle.value != "")
	 	subtitle = 1;
	else
		subtitle = 0;

	Obj.imgEdit.value = 0;
	Obj.imgEdit5.value = 0;
	Obj.imgEdit6.value = 0;
	Obj.imgEdit7.value = 0;
	Obj.imgEdit8.value = 0;
	Obj.imgEdit9.value = 0;
	Obj.imgEdit10.value = 0;
	Obj.imgEdit11.value = 0;
	Obj.imgEdit12.value = 0;

	if(Obj.Mimagename1 != undefined)
	{
		if(Obj.previousImg.value == Obj.Mimagename1.value)
			Obj.imgEdit.value = 1;
	}
		if(Obj.preimage1.value == Obj.imagename1.value)
			Obj.imgEdit5.value = 1;

		if(Obj.preimage2.value == Obj.imagename2.value)
			Obj.imgEdit6.value = 1;

		if(Obj.preimage3.value == Obj.imagename3.value)
			Obj.imgEdit7.value = 1;

		if(Obj.preimage4.value == Obj.imagename4.value)
			Obj.imgEdit8.value = 1;


	if(Obj.preimage5.value == Obj.imagename5.value)
		Obj.imgEdit9.value = 1;

	if(Obj.preimage6.value == Obj.imagename6.value)
		Obj.imgEdit10.value = 1;
	
	if(Obj.preimage7.value == Obj.imagename7.value)
		Obj.imgEdit11.value = 1;

	if(Obj.preimage8.value == Obj.imagename8.value)
		Obj.imgEdit12.value = 1;
	
//		var imgEdit = Obj.imgEdit.value;

	if(Obj.auctiontype.value == "estore")
	{
		window.open("product_estore_editpreview.php?id="+s.id.value+"&image1="+s.imagename1.value+"&extra="+s.extra.value+"&flag="+s.flag.value+"&flag2="+s.flag2.value+"&bold="+s.bold1.value+"&border="+s.border1.value+"&highlight="+s.highlight1.value+"&subtitle="+subtitle+"&featuredprod="+s.featuredprod1.value,'Preview',"width=790,height=630,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no");
	}else{
		window.open("product_auction_editpreview.php?thid="+Obj.third_id.value+"id="+Obj.prod_id.value+"&image1="+Obj.imagename1.value+"&extra="+Obj.extra.value+"&flag="+Obj.flag.value+"&flag2="+Obj.flag2.value+"&bold="+Obj.bold1.value+"&border="+Obj.border1.value+"&highlight="+Obj.highlight1.value+"&subtitle="+Obj.subtitle.value+"&imgEdit="+Obj.imgEdit.value+"&featuredprod="+Obj.featuredprod1.value,'Preview',"width=790,height=630,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no");
	}

//window.open("auction_product_detail_display.php?p_id=41");
}

function displayPreview(frm)
{
	document.add_prod.target = "_blank";
	document.add_prod.action = "product_estore_preview.php";
}

/////////////////////html area function

var editor = null;
function initEditor() {
  // create an editor for the "ta" textbox
  editor = new HTMLArea("textdesc");

  // register the TableOperations plugin with our editor
  editor.registerPlugin("TableOperations");

  editor.generate();
  return false;
}

function insertHTML() {
  var html = prompt("Enter some HTML code here");
  if (html) {
    editor.insertHTML(html);
  }
}
function highlight() {
  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
}



var editorcs = null;
	
function funeditor(t){
	// create an editor for the "ta" textbox
	editorcs = new HTMLArea(t);
	// register the TableOperations plugin with our editor
	editorcs.registerPlugin("TableOperations");
	editorcs.generate(); 
}
///// category options...
function validate_option(k)
{
if (k.chk_option!=null)
	{ 
		flag=false
		var pids="";
		var i=k.chk_option.length;
		//alert(g.payment_methods.length);
		if(i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(k.chk_option[i1].checked)
				{
					if(i1==0)
					{
						pids=k.chk_option[i1].value;
					}
					else
					{
						pids=pids+",";
						pids=pids + k.chk_option[i1].value;
					}
					flag=true;
				}
			}
			k.pids.value=pids;
		}
		else
		{
			if(k.chk_option[0].checked)
			{
				pids=k.chk_option[0].value;
				flag=true
				k.pids.value=pids;
			}
		}
		if(flag==false)
		{
		    alert("Select an option value")
			
			return false;
			
		}
	}
	else
	{
		alert("Cann't Proceed")
		return false
	}
}

//// E-store Functions....
function validate_step1_estore(s1,step2,step3)
{
	if(trim(s1.id.value)=="")
	{
		alert("Please Select Category to List Product")
		return false
	}
	if(trim(s1.product_name.value)=="")
	{
		alert("Please Enter Product Name")
		s1.product_name.focus()
		return false
	}//added By Megha on 07-Oct-2010 
	else{
			if(!validUserName(s1.product_name.value))
			{
				alert("Please Enter Valid Product Name.");
				s1.product_name.focus()
				return false
			}
		}	
	if(trim(editor.getInnerHTML())=="")
	{
		alert("Please Describe About Your Product, Enter Description")
		//s1.textdesc.focus()
		return false
	}
	//s1.tid.value=s1.Category3.value;
	hide_display(step2,step3)

}

function validate_step2_estore(s1,step3,step2)
{
	if(trim(s1.cost.value)=="")
	{
		alert("Enter Product cost")
		s1.cost.focus()
		return false
	}
	else
	{
		if (trim(s1.cost.value)==0)
		{
			alert("Product cost Greater Than '0'")
			s1.cost.focus
			return false
		}
		if (checkFloat(s1.cost.value)!=true)
		{ 
				alert("Enter a Valid Product cost");	
				s1.cost.focus();
				return false;
		}
	}
	if(trim(s1.item_location.value)=="")
	{
				alert("Enter Item location");	
				s1.item_location.focus();
				return false;
	}
	if(s1.Qty.value=="")
 		{
			alert("Enter the Quantity");
			s1.Qty.focus();
			return false; 
		}
		else if (s1.Qty.value==0)
		{
			alert("Quantity Should Greater Than '0'");
			s1.Qty.focus();
			return false; 
		}
		else 
		{
			x = allDigits(s1.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				s1.Qty.focus();
				return false;
			}
		}
	
	if(s1.ListingStartTime.value=="")
	{
		alert("Please Select Bid Start Date & Time")
		s1.ListingStartTime.focus()
		return false
	}

	hide_display(step3,step2)	
}
function change_val(frm)
{
	frm.extra.value = frm.ListingDuration.value;
	return true;
}

/// E-store product adding completed...

// product Add functions
function validate_step1(s1,step2,step3)
{
	x = new Array()
	for (var i=0; i < 2; i++)
   	{
	   	if(s1.two_w[i].checked)	
		{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[0] = "2W Anti-Lock Brakes - "+str;
			
		}
		if(s1.four_w[i].checked)	
		{
			if(s1.four_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[1] = "4W Anti-Lock Brakes - "+str;
		}
		if (s1.front[i].checked)
	  	{
		  if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[2] = "Front Air Conditioning - "+str;
		}
		if (s1.front_rear[i].checked)
	  	{
		 	if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[3] = "Front &amp; Rear Air Conditioning - "+str;
		}
		if (s1.cruise_control[i].checked)
	  	{
		 	if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[4] = "Cruise Control - "+str;
		}
		if (s1.fm_radio[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[5] = "AM/FM Radio - "+str;
		}
		if (s1.cassette[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[6] = "Cassette - "+str;
		}
		if (s1.cd[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[7] = "Compact Disc - "+str;
		}
		if (s1.cd_changer[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[8] = "CD Changer - "+str;
		}
		if (s1.premium_radio[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[9] = "Premium Radio - "+str;
		}
		if (s1.dvd[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[10] = "DVD Entertainment System - "+str;
		}
		if (s1.cup_holder[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[11] = "Cup Holder - "+str;
		}
		if (s1.leather_seats[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[12] = "Leather seats - "+str;
		}
		if (s1.navigation_sys[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[13] = "Navigation System - "+str;
		}
		if (s1.privacy_glass[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[14] = "Privacy Glass - "+str;
		}
		if (s1.hands_free[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[15] = "Hands Free Phone - "+str;
		}
		if (s1.power_locks[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[16] = "Power Locks - "+str;
		}
		if (s1.power_outlets[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[17] = "Power Outlets - "+str;
		}
		if (s1.power_mirror[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[18] = "Power Mirrors - "+str;
		}
		if (s1.remote_mirror[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[19] = "Remote Mirrors - "+str;
		}
		if (s1.power_seat[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[20] = "Power Seat - "+str;
		}
		if (s1.dual_power[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[21] = "Dual Power Seats - "+str;
		}
		if (s1.folding_rear[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[22] = "Folding Rear Seat - "+str;
		}
		if (s1.moon[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[23] = "Moon Roof - "+str;
		}
		if (s1.sun[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[24] = "Sun Roof - "+str;
		}
		if (s1.remote_key[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[25] = "Remote Keyless Entry - "+str;
		}
		if (s1.luggage[i].checked)
	  	{
		  if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[26] = "Luggage Rack - "+str;
		}
		if (s1.rear_win[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[27] = "Rear Window Defroster - "+str;
		}
		if (s1.tilt[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[28] = "Tilt Wheel - "+str;
		}
		if (s1.tachometer[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[29] = "Tachometer - "+str;
		}
		if (s1.traction[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[30] = "Traction Control - "+str;
		}
		if (s1.power_win[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[31] = "Power Windows - "+str;
		}
		if (s1.upgraded[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[32] = "Upgraded Wheels - "+str;
		}
		if (s1.power_steer[i].checked)
	  	{
			if(s1.two_w[i].value == 0){
				str="Standard"
			}
			else {
				str="Not available"
			}
			x[33] = "Power Steering - "+str;
		}
	}
	s1.equipment.value = x
	//confirm(x)
	//alert(x.length)
	
	if(trim(s1.id.value)=="")
	{
		alert("Please Select Category to List Product")
		return false
	}
	if(trim(s1.product_name.value)=="")
	{
		alert("Please Enter Product Name")
		s1.product_name.focus()
		return false
	}//added By Megha on 07-Oct-2010 
	else{
			if(!validUserName(s1.product_name.value))
			{
				alert("Please Enter Valid Product Name.");
				s1.product_name.focus();
				return false;
			}
		}		
	/*if(trim(s1.textdesc.value)=="")
	{
		alert("Please Describe About Your Product, Enter Description")
		return false	
		
		
	}/*
	if(trim(editor.getInnerHTML())=="")
	{
		alert("Please Describe About Your Product, Enter Description")
	//	s1.textdesc.focus()
		return false
	}*/
	var oEditor = FCKeditorAPI.GetInstance('textdesc') ;

	var v1 = oEditor.GetXHTML( true );

	if(oEditor.GetXHTML( true )=="")
	{
		alert("Please Describe About Your Product, Enter Description");
		return false;
	}
	/*if(v2 ==0)
	{
		alert("Enter valid content");
		return false;
	}*/
	if(s1.flag.value == 1)
	{
		if(s1.model.value == "")
		{
			alert("Enter the Model")
			s1.model.focus()
			return false;
		}
		if(s1.make.value == "")
		{
			alert("Enter the Make")
			s1.make.focus()
			return false;
		}
		if(s1.year1.value == "0")
		{
			alert("Select the Year")
			s1.year1.focus()
			return false;
		}
		if(s1.vin.value == "")
		{
			alert("Enter the Vehicle Identification Number")
			s1.vin.focus()
			return false;
		}
		/*if(isNaN(s1.vin.value))
		{
			alert("Vehicle Identification Number should be numeric")
			s1.vin.focus()
			return false;
		}*/
		if(s1.mileage.value == "")
		{
			alert("Enter the Mileage")
			s1.mileage.focus()
			return false;
		}
		if(isNaN(s1.mileage.value))
		{
			alert("Mileage should be numeric")
			s1.mileage.focus()
			return false;
		}
		/*if(add_prod.color.value == "0")
		{
			alert("Select the Color")
			add_prod.color.focus()
			return false;
		}*/
		if(s1.cc.value == "")	
		{
			alert("Enter the Cubic Capacity(CC)")
			s1.cc.focus()
			return false;
		}
		if(isNaN(s1.cc.value))	
		{
			alert("Cubic Capacity(CC) should be numeric")
			s1.cc.focus()
			return false;
		}
	}
	if(s1.flag.value == 2)
	{
		if(s1.address.value == "")
		{
			alert("Enter the Address")
			add_prod.address.focus()
			return false;
		}
	/*	if(s1.zip.value == "")
		{
			alert("Enter the Zip")
			s1.zip.focus()
			return false;
		}
		if(isNaN(s1.zip.value))
		{
			alert("Zip should be numeric")
			s1.zip.focus()
			return false;
		}  */
		if(s1.avail.value == "0")
		{
			alert("Select the Availability")
			s1.avail.focus()
			return false;
		}
		if(s1.type.value == "0")
		{
			alert("Select the Type")
			s1.type.focus()
			return false;
		}
		if(s1.year2.value == "")
		{
			alert("Enter the Year")
			s1.year2.focus()
			return false;
		}
		if(s1.sft.value == "")
		{
			alert("Enter the Square Foot")
			s1.sft.focus()
			return false;
		}
		if(isNaN(s1.sft.value))
		{
			alert("Square Foot should be numeric")
			s1.sft.focus()
			return false;
		}
		if(s1.size.value == "")
		{
			alert("Enter the Size(Acres)")
			s1.size.focus()
			return false;
		}
		if(isNaN(s1.size.value))
		{
			alert("Size(Acres) should be numeric")
			s1.size.focus()
			return false;
		}
		if(isNaN(s1.no_bedroom.value))
		{
			alert("No. of Bed Rooms should be numeric")
			s1.no_bedroom.focus()
			return false;
		}
		if(isNaN(s1.no_bathroom.value))
		{
			alert("No. of Bath Rooms should be numeric")
			s1.no_bathroom.focus()
			return false;
		}
	}
	if(s1.flag.value == 3)
	{
		if(s1.title.value == "")
		{
			alert("Enter the Song Title")
			s1.title.focus()
			return false;
		}
		if(s1.artist.value == "")
		{
			alert("Enter the Artist Name")
			s1.artist.focus()
			return false;
		}
		if(s1.album.value == "")
		{
			alert("Enter the Album Name")
			s1.album.focus()
			return false;
		}
		if(s1.release_date.value == "")
		{
			alert("Enter the Release Date")
			s1.release_date.focus()
			return false;
		}
		if(s1.label.value == "")
		{
			alert("Enter the Label")
			s1.label.focus()
			return false;
		}
		if(s1.genre.value == "")
		{
			alert("Enter the Genre")
			s1.genre.focus()
			return false;
		}
		if(s1.file_format.value == "")
		{
			alert("Enter the File Format")
			s1.file_format.focus()
			return false;
		}
		if(s1.add_info.value == "")
		{
			alert("Enter the Additional Information")
			s1.add_info.focus()
			return false;
		}
		if(s1.samp_url.value == "")
		{
			alert("Upload the Sample Audio file")
			s1.samp_url.focus()
			return false;
		}
		if(s1.prod_url.value == "")
		{
			alert("Upload the Audio file")
			s1.prod_url.focus()
			return false;
		}
	}
	s1.checkedS1.value = 1;
	hide_display(step2,step3)
}

function validate_step2(s1,step3,step2)
{
	if(s1.rdodefault != undefined)
	{
		if(s1.rdodefault.length!=undefined)
		{
			for(i=0;i<s1.rdodefault.length;i++)
			{
				if(s1.rdodefault[i].checked==true)
				{
					s1.defaultImage.value = s1.rdodefault[i].value;
				}
			}
		}else
		{
			s1.defaultImage.value = s1.rdodefault.value;
		}

	}else
	{
		s1.defaultImage.value = "";
	}

	if(trim(s1.auctiontype.value)=="")
	{
		alert("Select an Auction type")
		s1.auctiontype.focus()
		return false
	}

	if(s1.bidallowed_min.value != "")
	{
		if (checkFloat(s1.bidallowed_min.value)!=true)
		{ 
			alert("Enter Valid Amount");	
			s1.bidallowed_min.focus();
			return false;
		}
	}
	
	//alert(s1.auctiontype.value);
	if(s1.auctiontype.value != "Reverse Auction"){
		if(trim(s1.bidstartamt.value)=="")
		{
			alert("Enter Bid Start Amount")	
			s1.bidstartamt.focus()	
			return false
		}
		if(s1.bidstartamt.value=="0")
		{
			alert("Bid Start Amount Greater Than '0'");
			s1.bidstartamt.focus();
			return false
		}
		if(trim(s1.product_type.value)=="")
		{
			alert("Enter condition of this item")	
			s1.product_type.focus()	
			return false
		}
	}
	
	if(s1.auctiontype.value != "Reverse Auction"){
		
			if (trim(s1.bidstartamt.value)==0)
			{
				alert("Bid Start Amount Greater Than '0'")
				s1.bidstartamt.focus
				return false
			}
			if (checkFloat(s1.bidstartamt.value)!=true)
			{ 
				alert("Enter a Valid Bid Start Amount");	
				s1.bidstartamt.focus();
				return false;
			}
		}
			
	if(s1.auctiontype.value == "Dutch Auction")
	{
		if(s1.Qty.value=="")
 		{
			alert("Enter the Quantity");
			s1.Qty.focus();
			return false; 
		}
		else if (s1.Qty.value==0)
		{
			alert("Quantity Should Greater Than '0'");
			s1.Qty.focus();
			return false; 
		}
		else 
		{
			x = allDigits(s1.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				s1.Qty.focus();
				return false;
			}
		}
	}
	if(s1.auctiontype.value == "Reserve Auction")
	{
		if(s1.prodreserveprice.value=="")
	 	{
			alert("Enter the Reserve Price");	
			s1.prodreserveprice.focus();
			return false; 
		}
		if (checkFloat(s1.prodreserveprice.value)!=true)
		{ 
				alert("Enter a Valid Reserve Price");	
				s1.prodreserveprice.focus();
				return false;
		}
		if(eval(s1.prodreserveprice.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Reserve Price Should Greater Than Start Amount");	
			s1.prodreserveprice.focus();
			return false; 
		}
	}
	if(s1.auctiontype.value == "Ghana Auction")
	{
		if(s1.tseconds.value=="")
	 	{
			alert("Enter the T Seconds");	
			s1.tseconds.focus();
			return false; 
		}
		if(s1.noofrunners.value=="")
	 	{
			alert("Enter the No of Runners");	
			s1.noofrunners.focus();
			return false; 
		}
		if(!(parseInt(s1.noofrunners.value)))
		{
			alert("No of Runners should be an Integer value");	
			s1.noofrunners.focus();
			return false; 
		}
		if(s1.prodmax.value=="")
	 	{
			alert("Enter the Product Selling Max Price");	
			s1.prodmax.focus();
			return false; 
		}
		if (checkFloat(s1.prodmax.value)!=true)
		{ 
				alert("Enter a Valid Max Price");	
				s1.prodmax.focus();
				return false;
		}
		if(eval(s1.prodmax.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Max Price Should Always Greater than Start Amount");	
			s1.prodmax.focus();
			return false; 
		}
		if(s1.prodcost.value == "")
		{
			alert("Enter the Fixed Amount");
			s1.prodcost.focus();
			return false;
		}
	}
	if(s1.auctiontype.value == "Extreme Auction")
	{
		if(s1.prodmax.value=="")
	 	{
			alert("Enter the Product Selling Max Price");	
			s1.prodmax.focus();
			return false; 
		}
		if (checkFloat(s1.prodmax.value)!=true)
		{ 
				alert("Enter a Valid Max Price");	
				s1.prodmax.focus();
				return false;
		}
		if(eval(s1.prodmax.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Max Price Should Always Greater than Start Amount");	
			s1.prodmax.focus();
			return false; 
		}
		if(s1.prodcost.value == "")
		{
			alert("Enter the Fixed Amount");
			s1.prodcost.focus();
			return false;
		}
	}
	if(s1.auctiontype.value != "Reverse Auction")
	{
	
		if (s1.prodcost.value!="") {
				if(checkFloat(s1.prodcost.value)!=true)
				{ 
						alert("Enter a Valid Price");	
						s1.prodcost.focus();
						return false;
				}

				if(parseInt(s1.bidstartamt.value) > parseInt(s1.prodcost.value))
				{ 
						alert("Enter Fixed Amount Greater Than Bid Starting Amount");
						s1.prodcost.focus();
						return false;
				}
				if(parseInt(s1.bidstartamt.value) == parseInt(s1.prodcost.value))
				{ 
						alert("Enter Fixed Amount Greater Than Bid Starting Amount");
						s1.prodcost.focus();
						return false;
				} 
				/*added by Megha 11-Nov-09*/
		}
	}
	if(s1.ListingStartTime.value=="")
	{
		alert("Please Select Bid Start Date & Time")
		s1.ListingStartTime.focus()
		return false
	}
	
	if(s1.flag2.value != "0")
	{
	    if((s1.imagename1.value=="") && (s1.imagename2.value=="") && (s1.imagename3.value=="") && (s1.imagename4.value=="") && (s1.imagename5.value=="") && (s1.imagename6.value=="") && (s1.imagename7.value=="") && (s1.imagename8.value==""))
		{
			alert("Select atleast one image")
			return false;
		}
		if(s1.defaultImage.value == "")
		{
			if(s1.imagename1.value != "")
			{
				s1.defaultImage.value = s1.imagename1.value;
				s1.defNo.value = 5;
			}
			else if(s1.imagename2.value != "")
			{
				s1.defaultImage.value = s1.imagename2.value;
				s1.defNo.value = 6;
			}else if(s1.imagename3.value != "")
			{
				s1.defaultImage.value = s1.imagename3.value;
				s1.defNo.value = 7;
			}else if(s1.imagename4.value != "")
			{
				s1.defaultImage.value = s1.imagename4.value;
				s1.defNo.value = 8;
			}
			else if(s1.imagename5.value != "")
			{
				s1.defaultImage.value = s1.imagename5.value;
				s1.defNo.value = 9;
			}
			else if(s1.imagename6.value != "")
			{
				s1.defaultImage.value = s1.imagename6.value;
				s1.defNo.value = 10;
			}
			else if(s1.imagename7.value != "")
			{
				s1.defaultImage.value = s1.imagename7.value;
				s1.defNo.value = 11;
			}
			else if(s1.imagename8.value != "")
			{
				s1.defaultImage.value = s1.imagename8.value;
				s1.defNo.value = 12;
			}
		}
	}
	s1.checkedS2.value = 1;
	hide_display(step3,step2);

	if(s1.bidstartamt.value!="")
	{
		var totBidAmount = s1.bidstartamt.value;
		s1.totalbidamt.value = totBidAmount;
		document.getElementById("totalbidamt").style.display="";
	}

	if(s1.prodcost.value!="")
	{
		var totAmount = s1.prodcost.value;
		s1.totalcost.value = totAmount;
		document.getElementById("totalcost").style.display="";

	}
}

function validate_Estorestep2(s1,step3,step2)
{
	if(s1.rdodefault != undefined)
	{
		if(s1.rdodefault.length!=undefined)
		{
			for(i=0;i<s1.rdodefault.length;i++)
			{
				if(s1.rdodefault[i].checked==true)
				{
					s1.defaultImage.value = s1.rdodefault[i].value;
				}
			}
		}else
		{
			s1.defaultImage.value = s1.rdodefault.value;
		}

	}else
	{
		s1.defaultImage.value = "";
	}

	if(trim(s1.auctiontype.value)=="")
	{
		alert("Select an Auction type")
		s1.auctiontype.focus()
		return false
	}

	if(s1.bidallowed_min.value != "")
	{
		if (checkFloat(s1.bidallowed_min.value)!=true)
		{ 
			alert("Enter Valid Amount");	
			s1.bidallowed_min.focus();
			return false;
		}
	}
	
	if(s1.auctiontype.value != "Reverse Auction"){
		if(trim(s1.bidstartamt.value)=="")
		{
			alert("Enter Fixed Amount.")	
			s1.bidstartamt.focus()	
			return false
		}
		if(trim(s1.bidstartamt.value)=="0")
		{
			alert("Enter Fixed Amount Greater Than '0'");
			s1.bidstartamt.focus();
			return false
		}
		if (checkFloat(s1.bidstartamt.value)!=true)
		{ 
			alert("Enter a Valid Fixed Amount.");	
			s1.bidstartamt.focus();
			return false;
		}
		if(s1.Qty.value=="")
 		{
			alert("Enter the Quantity");
			s1.Qty.focus();
			return false; 
		}
		else if (s1.Qty.value==0)
		{
			alert("Quantity Should Greater Than '0'");
			s1.Qty.focus();
			return false; 
		}
		else 
		{
			x = allDigits(s1.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				s1.Qty.focus();
				return false;
			}
		}
		
		if(s1.product_type.value=="")
 		{
			alert("Enter condition of this item");
			s1.product_type.focus();
			return false; 
		}
	}
	
			
	if(s1.auctiontype.value == "Dutch Auction")
	{
		if(s1.Qty.value=="")
 		{
			alert("Enter the Quantity");
			s1.Qty.focus();
			return false; 
		}
		else if (s1.Qty.value==0)
		{
			alert("Quantity Should Greater Than '0'");
			s1.Qty.focus();
			return false; 
		}
		else 
		{
			x = allDigits(s1.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				s1.Qty.focus();
				return false;
			}
		}
	}
	if(s1.auctiontype.value == "Reserve Auction")
	{
		if(s1.prodreserveprice.value=="")
	 	{
			alert("Enter the Reserve Price");	
			s1.prodreserveprice.focus();
			return false; 
		}
		if (checkFloat(s1.prodreserveprice.value)!=true)
		{ 
				alert("Enter a Valid Reserve Price");	
				s1.prodreserveprice.focus();
				return false;
		}
		if(eval(s1.prodreserveprice.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Reserve Price Should Greater Than Fixed Amount");	
			s1.prodreserveprice.focus();
			return false; 
		}
	}
	if(s1.auctiontype.value == "Ghana Auction")
	{
		if(s1.tseconds.value=="")
	 	{
			alert("Enter the T Seconds");	
			s1.tseconds.focus();
			return false; 
		}
		if(s1.noofrunners.value=="")
	 	{
			alert("Enter the No of Runners");	
			s1.noofrunners.focus();
			return false; 
		}
		if(!(parseInt(s1.noofrunners.value)))
		{
			alert("No of Runners should be an Integer value");	
			s1.noofrunners.focus();
			return false; 
		}
		if(s1.prodmax.value=="")
	 	{
			alert("Enter the Product Selling Max Price");	
			s1.prodmax.focus();
			return false; 
		}
		if (checkFloat(s1.prodmax.value)!=true)
		{ 
				alert("Enter a Valid Max Price");	
				s1.prodmax.focus();
				return false;
		}
		if(eval(s1.prodmax.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Max Price Should Always Greater than Fixed  Amount");	
			s1.prodmax.focus();
			return false; 
		}
		if(s1.prodcost.value == "")
		{
			alert("Enter the Fixed Amount");
			s1.prodcost.focus();
			return false;
		}
	}
	if(s1.auctiontype.value == "Extreme Auction")
	{
		if(s1.prodmax.value=="")
	 	{
			alert("Enter the Product Selling Max Price");	
			s1.prodmax.focus();
			return false; 
		}
		if (checkFloat(s1.prodmax.value)!=true)
		{ 
				alert("Enter a Valid Max Price");	
				s1.prodmax.focus();
				return false;
		}
		if(eval(s1.prodmax.value)<=eval(s1.bidstartamt.value))
	 	{
			alert("Max Price Should Always Greater than Fixed Amount");	
			s1.prodmax.focus();
			return false; 
		}
		if(s1.prodcost.value == "")
		{
			alert("Enter the Fixed Amount");
			s1.prodcost.focus();
			return false;
		}
	}
	if(s1.auctiontype.value != "Reverse Auction")
	{
		if (s1.prodcost.value!="") {
			if (checkFloat(s1.prodcost.value)!=true)
			{ 
					alert("Enter a Valid Price");	
					s1.prodcost.focus();
					return false;
			}
		}
	}
	if(s1.ListingStartTime.value=="")
	{
		alert("Please Select Listing Time")
		s1.ListingStartTime.focus()
		return false
	}
	if(s1.flag2.value != "0")
	{
	     if((s1.imagename1.value=="") && (s1.imagename2.value=="") && (s1.imagename3.value=="") && (s1.imagename4.value=="") && (s1.imagename5.value=="") && (s1.imagename6.value=="") && (s1.imagename7.value=="") && (s1.imagename8.value==""))
			{
				alert("Select atleast one image")
				return false;
			}
				if(s1.defaultImage.value == "")
		{
			if(s1.imagename1.value != "")
			{
				s1.defaultImage.value = s1.imagename1.value;
				s1.defNo.value = 5;
			}
			else if(s1.imagename2.value != "")
			{
				s1.defaultImage.value = s1.imagename2.value;
				s1.defNo.value = 6;
			}else if(s1.imagename3.value != "")
			{
				s1.defaultImage.value = s1.imagename3.value;
				s1.defNo.value = 7;
			}else if(s1.imagename4.value != "")
			{
				s1.defaultImage.value = s1.imagename4.value;
				s1.defNo.value = 8;
			}
			else if(s1.imagename5.value != "")
			{
				s1.defaultImage.value = s1.imagename5.value;
				s1.defNo.value = 9;
			}
			else if(s1.imagename6.value != "")
			{
				s1.defaultImage.value = s1.imagename6.value;
				s1.defNo.value = 10;
			}
			else if(s1.imagename7.value != "")
			{
				s1.defaultImage.value = s1.imagename7.value;
				s1.defNo.value = 11;
			}
			else if(s1.imagename8.value != "")
			{
				s1.defaultImage.value = s1.imagename8.value;
				s1.defNo.value = 12;
			}
		}
	}
	s1.checkedS2.value = 1;
	hide_display(step3,step2);

	if(s1.bidstartamt.value!="")
	{
		var totAmount = s1.bidstartamt.value;
		s1.totalcost.value = totAmount;
		document.getElementById("totalcost").style.display="";
	}

}
function validate_step3(s1)
{
	
}
function val_check_gift(s1)
{
	if(s1.ship_courier.value == '')
	{
	alert("Please select shipping courier.");
	s1.ship_courier.focus();
	return false;
	}	
	if(document.getElementById("is_gift").checked)
	{
		if(trim(s1.gift_MainCategory.value)=="")
		{
			if(s1.gift_MainCategory.options[0].text!="No Subcategories")
			{
				alert("Please Select Gift Top Level Category")
				s1.gift_MainCategory.focus();
				document.add_prod.btnsubmit.disabled=false;
				return false
			}
		}
		if(trim(s1.gift_Category2.value)=="")
		{
				alert("Please Select Gift Middle Level Category")
				s1.gift_Category2.focus();
				document.add_prod.btnsubmit.disabled=false;
				return false
		}
		if(trim(s1.gift_Category3.value)=="")
		{
				alert("Please Select Gift Low Level Category")
				s1.gift_Category3.focus();
				document.add_prod.btnsubmit.disabled=false;
				return false
		}
		if(trim(s1.occasion.value)=="")
		{
			alert("Please Select Gift Occasion")
			s1.occasion.focus();
			document.add_prod.btnsubmit.disabled=false;	
			return false
		}
	}
	
}
/*if(s1.ship_courier.value == 'other')
	{
		if(s1.chkCon.value == 'no' )
		{
			alert("You have selected 'Other' Shipping Courier \n Please add other courier and enter valid data.")
			return false;			
		}
		else
		{
			var chkDup = 'no';
			return check_courier(s1,chkDup);	
		}
		
	}*/
function hide(a1)
{ 
	if (a1.auctiontype.value == "Extreme Auction")
	{		
		document.getElementById('fixed').style.display="";
		document.getElementById('fixed').style.visibility='visible';
		document.getElementById('maximum').style.display="";
		document.getElementById('maximum').style.visibility='visible';
		document.getElementById('reserve').style.display="none";
		document.getElementById('reserve').style.visibility='hidden';
		document.getElementById('quantity').style.display="none";
		document.getElementById('quantity').style.visibility='hidden';
		document.getElementById('tsec').style.display="none";
		document.getElementById('tsec').style.visibility='hidden';
		document.getElementById('nor').style.display="none";
		document.getElementById('nor').style.visibility='hidden';

		return true;
	}
    else if (a1.auctiontype.value == "Reserve Auction")
	{
		document.getElementById('fixed').style.display="";
		document.getElementById('fixed').style.visibility='visible';
		document.getElementById('reserve').style.display="";
		document.getElementById('reserve').style.visibility='visible';
		document.getElementById('quantity').style.display="none";
		document.getElementById('quantity').style.visibility='hidden';
		document.getElementById('maximum').style.display="none";
		document.getElementById('maximum').style.visibility='hidden';
		document.getElementById('tsec').style.display="none";
		document.getElementById('tsec').style.visibility='hidden';
		document.getElementById('nor').style.display="none";
		document.getElementById('nor').style.visibility='hidden';

		return true;
	}
	else if (a1.auctiontype.value == "Ghana Auction")
	{
		document.getElementById('fixed').style.display="";
		document.getElementById('fixed').style.visibility='visible';
		document.getElementById('maximum').style.display="";
		document.getElementById('maximum').style.visibility='visible';
		document.getElementById('tsec').style.display="";
		document.getElementById('tsec').style.visibility='visible';
		document.getElementById('nor').style.display="";
		document.getElementById('nor').style.visibility='visible';
		document.getElementById('quantity').style.display="none";
		document.getElementById('quantity').style.visibility='hidden';
		document.getElementById('reserve').style.display="none";
		document.getElementById('reserve').style.visibility='hidden';
		return true;
	}
	else if (a1.auctiontype.value == "Dutch Auction")
	{
		document.getElementById('quantity').style.display="";
		document.getElementById('quantity').style.visibility='visible';
		document.getElementById('reserve').style.display="none";
		document.getElementById('reserve').style.visibility='hidden';
		document.getElementById('fixed').style.display="none";
		document.getElementById('fixed').style.visibility='hidden';
		document.getElementById('maximum').style.display="none";
		document.getElementById('maximum').style.visibility='hidden';
		document.getElementById('tsec').style.display="none";
		document.getElementById('tsec').style.visibility='hidden';
		document.getElementById('nor').style.display="none";
		document.getElementById('nor').style.visibility='hidden';

		return true;
	}
	else if (a1.auctiontype.value == "Standard Auction")
	{
		document.getElementById('fixed').style.display="";
		document.getElementById('fixed').style.visibility='visible';
		document.getElementById('quantity').style.display="none";
		document.getElementById('quantity').style.visibility='hidden';
		document.getElementById('reserve').style.display="none";
		document.getElementById('reserve').style.visibility='hidden';
		document.getElementById('maximum').style.display="none";
		document.getElementById('maximum').style.visibility='hidden';
		document.getElementById('tsec').style.display="none";
		document.getElementById('tsec').style.visibility='hidden';
		document.getElementById('nor').style.display="none";
		document.getElementById('nor').style.visibility='hidden';

		return true;
	}
}


function getvalue(x,id)
{
	id.value=x.value;
	//alert(id.value);
}

function hide_display(div1,s1)
{
	if (s1=="step1")
	{
		step1.style.display=""
		step2.style.display="none"
		step3.style.display="none"
	} 
	else if(s1=="step2") {
		step2.style.display=""
		step1.style.display="none"
		step3.style.display="none"
	}
	else if (s1=="step3"){
		///if(add_prod.case1.value != 11)
		//	ship.style.display=""
		step3.style.display=""
		step1.style.display="none"
		step2.style.display="none"
	}
	else if (s1=="gift_div"){
		if(document.getElementById("is_gift").checked)
			document.getElementById("gift_div").style.display=""
		if(!document.getElementById("is_gift").checked)
			document.getElementById("gift_div").style.display="none"
	}
}

function display_pictures()
{
	if(pictures.style.display=="none")
	{
		pictures.style.display=""
		add_prod.flag2.value = 1
	}
	else
	{
		add_prod.flag2.value = 0
		pictures.style.display="none"
	}
}

function hide_all()
{
	
	document.getElementById('step2').style.display="none"
	document.getElementById('step3').style.display="none"
	
}

// deleting email...
		
		
function validate_s_inbox(k)
{
	flag="No"
	values="0"
	if(form1.Mid1)
	{
		i=form1.Mid1.length
		
		if (i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(form1.Mid1[i1].checked){
					flag="yes"
					values=values +"," + form1.Mid1[i1].value
				}
			}
		}
		else
		{
			if(form1.Mid1.checked) {
			flag="yes"
				values=values +"," + form1.Mid1.value
			}
		}
	}
	if (flag=="yes")
	{
		if (confirm('Do you really want to delete selected mail(s).') == true)
		{
		form1.action='seller_tasks1.php';
		form1.Mid.value=values;
		form1.submit();
		return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		alert("Please select records to delete.")
		return false
	}
}
// deleting email over ..

/// estore functions

function validate_estore(s1)
{

	if(s1.templ.value =="")
	{
		alert("Select Store Templates.")
		s1.templ.focus()
		return false;
	}
	if(document.getElementById("chkthis").checked == true)
	{
		if(s1.seller_logo.value =="")
			{
				alert("Select Store Logo.");		
				s1.seller_logo.focus();			
				return false;	
			}	
	}
	if(trim(s1.store_name.value)=="")
	{
		alert("Enter Store Name")
		s1.store_name.focus()
		return false;
	}
	if(trim(s1.abt.value)=="")
	{
		alert("Enter Store Description")
		s1.abt.focus()
		return false;
	}
	if(trim(s1.cat.value)=="")
	{
		alert("Enter Store Category")
		s1.cat.focus()
		return false;
	}
	if(trim(s1.policy.value)=="")
	{
		alert("Enter Store Privacy Policy")
		s1.policy.focus()
		return false;
	}
	if(trim(s1.ship_policy.value)=="")
	{
		alert("Enter Store Shipping Policy")
		s1.ship_policy.focus()
		return false;
	}
	if(s1.twitter_username.value != "")
	{
			if(!validUserName(s1.twitter_username.value))
			{
				alert("Please enter valid Twitter username!")
				s1.twitter_username.focus()
				return false;
			}
	}
		document.test.btnsubmit.disabled = true;

}
/// add payment methods

	function location_addpayment(val)
	{
		location.href = "add_payment_gateway.php?pay="+val.value;
	}


function validate_payment_one(g)
{
	// var g=window.document.forms[0];
	 if(g.addinfo.value=="")
	 {
		 alert ("Please enter the additional info");
		 g.addinfo.focus();
		 return false;
	 }
	 return true;
}
function validate_payment_two(g)
{
	// var g=window.document.forms[0];
	 if(g.login.value=="")
	 {
		 alert ("Please enter login");
		 g.login.focus();
		 return false;
	 }
	 return true;
}

/// Editing the Seller details..
function submit_seller_edit(regform)
{
		
			flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 } 
	/*if(trim(regform.company.value)=="")
	 {
		alert("Please Enter Company Name")
		regform.company.focus();
		return false
	 }*/

	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Street Name")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {		 
		if(regform.country.value=="USA")
		{
			if(regform.state.value=="")
			{				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			}
			 
		 }
		else if(regform.country.value=="Ghana")
		{			 
			if(regform.state1.value=="")
			{				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }
		else
		{
			 regform.state2.focus();
		 	 alert("Please Select State Name")			
			 return false
		 }
		 /*
	 	if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state2.focus();
		 	alert("Please Enter State Name")			
		}
		if(document.getElementById("state2").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state.focus();
		 	alert("Please Select State Name")			
		}
		if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("state2").style.display=='none'){
			regform.state1.focus();		
		 	alert("Please Select State Name")	
		}*/		
	 }
	 /*
	if(trim(regform.zip.value)=="")
	 {
	 	alert("Please Enter Zip Code")
		regform.zip.focus();
		return false
	 }
	if (checkNum(regform.zip.value)!=true)
	{
		alert("Please Enter Correct Zip Code")
		regform.zip.focus();
		return false
	}*/
	/*if(regform.country.value=="USA"){
		var s=regform.zip.value;
		if (s.length!=5)
		{
			alert("Please Enter Correct Zip Code")
			regform.zip.focus();
			return false
		}
	}*/
		 
	if(trim(regform.email.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	else
	{
		st=regform.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email.focus();
			return false
		}
	}
    if(trim(regform.day.value)=="")
	{
		alert("Please Select Day")
		regform.day.focus();
		return false
	}
	if(trim(regform.month.value)=="")
	{
		alert("Please Select Month")
		regform.month.focus();
		return false
	}
	if(trim(regform.year.value)=="")
	{
		alert("Please Select year")
		regform.year.focus();
		return false
	}
	if(a2<18)
	{		
		alert("Sorry, You are Under-aged, you cannot proceed further");
		//}
		regform.day.focus();
		return false; 
	}
	else
	{
		regform.age.value=a2		
	}
	 if(trim(regform.comp_phone.value)=="")
	 {
		alert("Please Enter Company Phone")
		regform.comp_phone.focus();
		return false
	 }	  
	 else
	 {
	 	 if (checkNum(regform.comp_phone.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.comp_phone.focus();
			return false
		}
	 }
	/* if(trim(regform.phone1.value)=="")
	 {
		alert("Please Enter Phone")
		regform.phone1.focus();
		return false
	 }	  
	 else
	 {*/
	 if(trim(regform.phone1.value)!="")
	 {
	 	 if (checkNum(regform.phone1.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone1.focus();
			return false
		}
	 }
	if (checkNum(regform.phone2.value)!=true)
	{
		alert("Please Enter Valid Phone No.")
		regform.phone2.focus();
		return false
	}
	/* if(trim(regform.ship_pol.value)=="")
	 {
		alert("Please Enter Shipping policy")
		regform.ship_pol.focus();
		return false
	 }	  
	 if(trim(regform.sell_pol.value)=="")
	 {
		alert("Please Enter Seller's Policy")
		regform.sell_pol.focus();
		return false
	 }	  
	 if(trim(regform.seller_logo.value)=="")
	 {
		alert("Please Upload Seller's Logo")
		regform.seller_logo.focus();
		return false
	 }	*/

	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	 if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter Userid")
		regform.userid.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.userid.value;
		if (s.length<6)
		{
			alert("UserID should have min. '6' characters")
			regform.userid.focus();
			return false
		}
	 }
	 if(trim(regform.password.value)=="")
	 {
		alert("Please Enter Password")
		regform.password.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.password.value;
		if (s.length<6)
		{
			alert("Password should have min. '6' characters")
			regform.password.focus();
			return false
		}
	 }
	if(trim(regform.confirmpassword.value)=="")
	 {
		alert("Please Confirm Password")
		regform.confirmpassword.focus();
		return false
	 }
	if(regform.password.value!=regform.confirmpassword.value)
	 {
		alert("Password and Confirm Password are not Same")
		regform.confirmpassword.focus();
		return false
	 }
	 
    if(trim(regform.s_answer.value)=="")
	 {
		alert("Please Enter Answer for Secret Question")
		regform.s_answer.focus();
		return false
	 }
	 if(regform.terms.checked==false)
	  {
	 	alert("To Register You have to Accept Our Terms & Conditions")
		return false
	 }
}

function submit_mngseller_edit(regform)
{
		
			flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 } 


	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Address")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {		 
		if(regform.country.value=="USA")
		{
			if(regform.state.value=="")
			{				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			}
			 
		 }
		else if(regform.country.value=="Ghana")
		{			 
			if(regform.state1.value=="")
			{				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }
		else
		{
			 regform.state2.focus();
		 	 alert("Please Select State Name")			
			 return false
		 }
	 }
	
	if(trim(regform.email.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	else
	{
		st=regform.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email.focus();
			return false
		}
	}
    if(trim(regform.day.value)=="")
	{
		alert("Please Select Day")
		regform.day.focus();
		return false
	}
	if(trim(regform.month.value)=="")
	{
		alert("Please Select Month")
		regform.month.focus();
		return false
	}
	if(trim(regform.year.value)=="")
	{
		alert("Please Select year")
		regform.year.focus();
		return false
	}
	 if(a2 == 'NaN')
	{
		
		alert("Please enter valid Day/Month/Year.");
	
		regform.day.focus();
		return false; 
	}else
	{
			if(a2<18)
			{		
				alert("Sorry, You are Under-aged, you cannot proceed further");
				//}
				regform.day.focus();
				return false; 
			}
			else
			{
				regform.age.value=a2		
			}
	}

	 if(trim(regform.comp_phone.value)=="")
	 {
		alert("Please Enter Company Phone")
		regform.comp_phone.focus();
		return false
	 }	  
	 else
	 {
	 	 if (checkNum(regform.comp_phone.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.comp_phone.focus();
			return false
		}
	 }
	
	 if(trim(regform.phone1.value)!="")
	 {
	 	 if (checkNum(regform.phone1.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone1.focus();
			return false
		}
	 }
	if (checkNum(regform.phone2.value)!=true)
	{
		alert("Please Enter Valid Phone No.")
		regform.phone2.focus();
		return false
	}
	
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	return true;
}

function validate_check(s)
{
	var https_url="https://www.ghanaauction.com/";
	flag=false
	if(s.service_id)
	{
		var len=s.service_id.length
		var j=0;
		if (len>1)
		{
			for(i=0;i<len;i++)
			{
				if(s.service_id[i].checked) {
					flag=true;
					j = i;
				}
			}
		}
		else
		{
			if(s.service_id.checked)	{
				flag=true; 
			}
		}
	}
	if (flag==false)
	{
		alert("Select a plan to proceed")
		return false
	}
	else
	{
		if(confirm("Your Service Plan Will Renew By Selected Plan. Do You Want To Continue With Selected Plan..?")) {
			if (len>1)
			{
				if(parseInt(s.hdnprice[j].value)!=0)
				{
					var obj				=	document.frmPB;
					obj.hdnPay.value	=	"SERVICEPLAN";
					obj.hdnback.value=	"seller/package_renew.php";
					obj.action			=	https_url+"payboard.php";
					obj.hdnServiceId.value	=	s.service_id[j].value;
					obj.hdnItemId.value	=	s.service_id[j].value;
					obj.submit();
					return false;
				}
			}else{
				if(parseInt(s.hdnprice.value)!=0)
				{
					var obj				=	document.frmPB;
					obj.hdnPay.value	=	"SERVICEPLAN";
					obj.hdnback.value=	"seller/package_renew.php";
					obj.action			=	https_url+"payboard.php";
					obj.hdnServiceId.value	=	s.service_id.value;
					obj.hdnItemId.value	=	s.service_id.value;
					obj.submit();
					return false;
				}
			}
			return true;
		}
		else
			return false;
	}
}

function validate_flatplan(s)
{
	if (s.txtDeliveryMethod.value=="")
	{
		alert("Please Enter Delivery Method")
		s.txtDeliveryMethod.focus();
		return false;
	}
	
	if (s.startprice.value!=="")
	{
		if ((checkFloat(s.startprice.value))!= true)
		{
		alert("Enter a Valid Starting Price");	
				s.startprice.focus();
				return false;
		}
	}
	else
	{
		alert("Please Enter Starting Price");	
		s.startprice.focus();
		return false;
	}
	if (s.endprice.value!=="")

	{
		if ((checkFloat(s.endprice.value))!= true)
	{
			alert("Enter a Valid Ending Price");	
			s.endprice.focus();
			return false;
	}
	}
	else
	{
			alert("Please enter Ending Price");	
			s.endprice.focus();
			return false;
	}
	if (s.txtfirstitemprice.value!=="")
	{
	
		if ((checkFloat(s.txtfirstitemprice.value))!= true)
		{
			alert("Enter a Valid First Item Price");	
			s.txtfirstitemprice.focus();
			return false;
		}
	}
	else
	{
			alert("Please enter First Item Price");	
			s.txtfirstitemprice.focus();
			return false;
	}
	if (s.txtadditionalprice.value!=="")
	{
		if ((checkFloat(s.txtadditionalprice.value))!= true)
		{
			alert("Enter a Valid Additional Item Price");	
			s.txtadditionalprice.focus();
			return false;
		}
	}
	else
	{
			alert("Please enter Additional Item Price");	
			s.txtadditionalprice.focus();
			return false;
	}	
}

function check_courier(s,chkDup)
{
	
		
	if (s.courier.value =="")
	{
		alert("Please add Courier.")
		s.courier.focus();
		return false;
	}
	else 
	{		
		if (s.courier.value == "other" && s.specifyOther.value=="")
		{
			
			alert("Please specify other Courier.")
			s.specifyOther.focus();
			return false;
		}
		/*else{
			
				if(s.courier.value == "other")
				{
				var getCurNm = s.specifyOther.value; 
				}
				else
				{
				var getCurNm = s.courier.value;
				}
				getCurNm = getCurNm.toLowerCase();

				getRoutefrm = s.route_from.value;
				getRouteto  = s.route_to.value;

				getRoutefrm = getRoutefrm.toLowerCase();
				getRouteto  = getRouteto.toLowerCase();
				
				
				var getStringVal = s.curiArrStr.value ;
				getStringVal = getStringVal.toLowerCase();			
				

				var isExist = getStringVal.indexOf(getCurNm); //give -1 if not present , index of array othrwise

				var presentCourier =  s.presentCourier.value// if edit condition			
				presentCourier = presentCourier.toLowerCase(); //make it in lower case
				
				//alert(getStringVal);
				//alert(isExist);
				//alert(getCurNm);
				//alert(presentCourier);
			if((isExist != '-1') && (getCurNm != presentCourier))
			{
				if(s.courier.value == "other")
				{
					alert("This Courier is already exist.")					
					s.specifyOther.value = "";
					s.specifyOther.focus();
					return false;
				}
				else
				{
				alert("This Courier is already exist.")					
				s.courier.focus();
				return false;
				}
				
			}
		}*/
	}
	if (s.courier.value == "In Store Pick-up")
	{
		if(s.item_location.value=="")
		{
		alert("Please enter Item Location.")
		s.item_location.focus();
		return false;
		}
	}
	else
	{
			if(s.route_from.value != "")
			{
				if(!validUserName(s.route_from.value))
						{
							alert("Please Enter Valid Route-From.");
							s.route_from.focus();
							return false;
						}			
			}else
			{
				alert("Please Enter Route-From");	
				s.route_from.focus();
				return false;
			}

			if(s.route_to.value != "")
			{
				if(!validUserName(s.route_to.value))
						{
							alert("Please Enter Valid Route-To.");
							s.route_to.focus();
							return false;
						}
			}else
			{
					alert("Please enter Route-To");	
					s.route_to.focus();
					return false;
			}
	}
	if (s.cost.value!=="")
	{
	
		if ((checkFloat(s.cost.value))!= true)
		{
			alert("Enter a Valid cost.");	
			s.cost.focus();
			return false;
		}
		/*if(s.courier.value != "In Store Pick-up" && s.cost.value <= 0)
		{
			alert("Enter a Valid cost.");	
			s.cost.focus();
			return false;
		}*/
	}
	else
	{
			alert("Please enter Cost.");	
			s.cost.focus();
			return false;
	}
	if (s.cost_per_additional_item.value!=="")
	{
		if ((checkFloat(s.cost_per_additional_item.value))!= true)
		{
			alert("Enter a Valid Cost Per Additional Item");	
			s.cost_per_additional_item.focus();
			return false;
		}
		/*if(s.courier.value != "In Store Pick-up" && s.cost_per_additional_item.value <= 0)
		{
			alert("Enter a Valid Cost Per Additional Item");	
			s.cost_per_additional_item.focus();
			return false;
		}*/
	}
	else
	{
			alert("Please enter Cost Per Additional Item");	
			s.cost_per_additional_item.focus();
			return false;
	}
	var getTm = document.getElementById('delivery_time').value;
	if (getTm == "other" && s.adDelvTm.value=="")
		{
			
			alert("Please specify other Delivery Time.")
			s.adDelvTm.focus();
			return false;
		}
	return true;
}

/*---Functions for shipping courier on 21-Dec-2010--*/
function addDiv()
{
document.getElementById("addCourier").style.display = "block";
document.getElementById('chkCon').value = "yes" // to check condition on confirm listing button
}

function courierOnchange(obj)
{
	var sellUrl = "http://www.ghanaauction.com/seller/";
	
	var getCurid = document.getElementById('ship_courier').value;
	/*if(getCurid == 'other')
	{
	document.getElementById('curiDetails').innerHTML="<a href=\"javaScript:addDiv()\">Add other courier</a>";
	}
	else
	{*/
	document.getElementById('curiDetails').innerHTML="<a href=\"javaScript: MM_openBrWindow_mid('"+sellUrl+"courier_view.php?curi_id="+getCurid+"');\">View details</a>";
	/*document.getElementById("addCourier").style.display = "none";

	document.getElementById('chkCon').value = "no"

	document.getElementById('courier').value = "";
	document.getElementById('route_from').value = "";
	document.getElementById('route_to').value = "";
	document.getElementById('cost').value = "";
	document.getElementById('cost_per_additional_item').value = "";*/

	//}

}
function fnDispaly(siteUrl)
{
	var opt = document.form1.shipMethod;
	var curi_id = opt.value;
	var optname = (opt.options[opt.selectedIndex].text);

	if(optname != "" && optname != "In Store Pick-up")
	{
		document.getElementById("otherdiv").style.display='block';
		document.getElementById("otherdiv1").style.display='block';
	}
	else
	{
		document.getElementById("otherdiv").style.display='none';
		document.getElementById("otherdiv1").style.display='none';
	}
	needToPay(curi_id,siteUrl)
}

function needToPay(curi_id,siteUrl)
{
	//alert('megha');
	var totCost = document.getElementById("prod_totalcost").value;
	var reqQty = document.getElementById("reqQty").value;
	//alert(reqQty);
		var parameters	=	"courier_id=" + curi_id + "&totCost="+totCost+"&reqQty="+reqQty+"&action=needToPay";
		var url				=	siteUrl+"seller/setShipDefaultAjax.php";
		xmlHttp				=	GetXmlHttpObject(getCourierRespose);
		xmlHttp.open("POST", url, false);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
		xmlHttp.send(parameters)
}

function getCourierRespose()
	{		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			//alert(xmlHttp.responseText) ;	
			if(xmlHttp.responseText != "")
			{
				document.getElementById("needPay").style.display='block';
				document.getElementById("needPay").innerHTML = xmlHttp.responseText;				
			}
			else
			{
				document.getElementById("needPay").style.display='none';
			}
		}
	}
/*-----end---Functions for shipping-------*/

function checkFloat(str)
 {
	if (!str) return 0;
	dot = 0;
	for (var i = 0; i < str.length; i++) 
	{
		var ch = str.substring(i, i+1);
		if ((ch < "0" || "9" < ch) && ch != '.')
		{
			return false;
		}
		else
		{
			if(ch==".")
			{
			dot++;
			}
			
		}
		if(dot>1)
		{
		return false
		}
	 }
	return true;
  }

function ship_type_validate(s)
{
	// Added by Blesy on 30/01/2009
	var a=document.ship['shipping_type[]'];
	if(document.getElementById("hdnShipVal").value == "0")
	{
		alert("Please select shipping type")
		return false
	}
	
	if(document.getElementById("hdnShipVal").value == "1")
	{
		if((s.flatrate_count.value=="0"))
		{
			alert("Before you select flat rate, you need to add the plan first");
			return false;
		}
	}else
	{


	var p=0;
	for(i=0;i<a.length;i++)
	{
		if(a[i].checked)
			p++;
	}
	if(p == 0)
	{
		alert("Please select atleast one shipping method.");
		return false;
	}else
		return true;
	}
	return true;
}

function show_window(s1)
{
	if (s1.value == "")
	{
		alert("Please Select Store Templates.");
		s1.focus();
		return false;
	}
	if (s1.value!="")
	{
		//MM_openBrWindow_scroll('../templates/default_template_preivew.php?css='+s1.value,'aa','')
		MM_openBrWindow_scroll('../tp/dt.php?css='+s1.value,'aa','')
	}
}

//////////////////////////////// all Seller panel functions Ending///////////////////////////////

//////////////////////////////// all admin panel functions///////////////////////////////

				//// Deleting email..
/*function validate_a_inbox(k)
{
	flag="No"
	if(form1.Mid)
{
	i=form1.Mid.length
	if (i>1)
	{
		for(i1=0;i1<i;i1++)
		{
		 	if(form1.Mid[i1].checked)
			flag="yes"
		}
	}
	else
	{
		if(form1.Mid.checked)
		flag="yes"
	}
}
	if (flag=="yes")
	{
		form1.action='adm_task1.php';
		form1.submit();
		return true;
	}
	else
	{
		alert("Select records to delete")
		return false
	}
}*/

function validate_a_inbox(k)
{
	flag="No"
	values="0"
	if(form1.Mid1)
	{
		i=form1.Mid1.length
		
		if (i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(form1.Mid1[i1].checked){
					flag="yes"
					values=values +"," + form1.Mid1[i1].value
				}
			}
		}
		else
		{
			if(form1.Mid1.checked) {
			flag="yes"
				values=values +"," + form1.Mid1.value
			}
		}
	}
	if (flag=="yes")
	{
		if(confirm('Are you sure you want to delete this record(s)?'))
		{
		form1.action='adm_task1.php';
		form1.Mid.value=values;
		form1.submit();
		return true;
		}
		return false;
	}
	else
	{

		alert("Select records to delete")
		return false
	}
}

// deleting email over ..
function validate_service_plan(s)
{
	
	var g		=	s;
	var id		=	g.id.value;

	if(g.name.value=="")
	{
		alert ("Please enter Plan name");
		g.name.focus();
		return false;
	}

	if(g.price.value!="" || parseInt(g.price.value)!=0)
	{
		if(isNaN(g.price.value))
		{
			alert ("Please enter correct value");
			g.price.focus();
			return false;
		}
	}

	if(g.add_amount.value!="" || parseInt(g.add_amount.value)!=0)
	{
		if(isNaN(g.add_amount.value))
		{
			alert ("Please enter correct trial amount");
			g.add_amount.focus();
			return false;
		}
	}

	if(g.min_deposit.value!="" || parseInt(g.min_deposit.value)!=0)
	{
		if(isNaN(g.min_deposit.value))
		{
			alert ("Please enter correct minimum deposit amount");
			g.min_deposit.focus();
			return false;
		}
	}

}

// start add new / update news validation process//
function adm_add_new_news_validate(form)
{
	if(trim(form.news_title.value)=="")
	{
		alert ("Please Enter News Title");
		form.news_title.focus();
		return false
	}
	if(trim(form.news_description.value)=="")
	{
		alert ("Please Enter Description");
		form.news_description.focus();
		return false
	}
	if(trim(form.published_date.value)=="")
	{
		alert ("Please Select Date");
		form.published_date.focus();
		return false
	}
	if(trim(form.published_by.value)=="")
	{
		alert ("Please Enter Publisher Name");
		form.published_by.focus();
		return false
	}
	if(trim(form.status.value)=="")
	{
		alert ("Please Select News Status");
		form.status.focus();
		return false
	}	
}

// end add new / update news validation process//

//start add new / update jobs validation process//

function adm_add_new_jobs_validate(form)
{
	if(trim(form.job_ref.value)=="")
	{
		alert ("Please Enter Job Reference");
		form.job_ref.focus();
		return false
	}
	
	if(trim(form.job_title.value)=="")
	{
		alert ("Please Enter Job Title");
		form.job_ref.focus();
		return false
	}
	
	if(trim(form.job_brief_desc.value)=="")
	{
		alert ("Please Enter Brief Description About Job");
		form.job_brief_desc.focus();
		return false
	}
	
	if(trim(form.job_description.value)=="")
	{
		alert ("Please Enter Job Description");
		form.job_description.focus();
		return false
	}
	
	if(trim(form.no_vacancies.value)=="")
	{
		alert ("Please Enter Number Of Vacancies");
		form.no_vacancies.focus();
		return false
	}
	
	if(trim(form.job_location.value)=="")
	{
		alert ("Please Enter Job Location");
		form.job_location.focus();
		return false
	}
	
	if(trim(form.skill_summary.value)=="")
	{
		alert ("Please Enter Skill Summary Of Job");
		form.skill_summary.focus();
		return false
	}
	
	if(trim(form.salary_range.value)=="")
	{
		alert ("Please Enter Salary Range");
		form.salary_range.focus();
		return false
	}
	
	if(trim(form.contact_details.value)=="")
	{
		alert ("Please Enter Contact Details");
		form.contact_details.focus();
		return false
	}
	
	if(trim(form.posted_date.value)=="")
	{
		alert ("Please Enter Job Posted Date");
		form.posted_date.focus();
		return false
	}
	
	if(trim(form.status.value)=="")
	{
		alert ("Please Enter Job Title");
		form.status.focus();
		return false
	}
}
// end add new / update jobs validation process//

function validate_contact(s)
{
	if(trim(s.c_name3.value)=="")
	{
		alert("Enter Subject")
		s.c_name3.focus()
		return false
	}
	if(trim(s.msg.value)=="")
	{
		alert("Enter Message")
		s.msg.focus()
		return false
	}
}
function adm_template_validate(s)
{
	if(trim(s.cat_name.value)=="")
	{
		alert("Please Enter Template Name")
		s.cat_name.focus()
		return false
	}
	
	if(trim(s.imagename1.value)=="")
	{
		alert("Please Upload Template File")
		return false
	}
}
function write_function(c)
{
	cat_name.innerHTML=c.MainCategory.options[c.MainCategory.selectedIndex].text + c.Category2.options[c.Category2.selectedIndex].text
}
function write_function_property(c)
{
	//cat_name.innerHTML=c.MainCategory.options[c.MainCategory.selectedIndex].text + c.Category2.options[c.Category2.selectedIndex].text +"-->"+ c.Category3.options[c.Category3.selectedIndex].text
}
function adm_login_validate(s)
{
	if(s.Admin.value=="")
	{
		alert("Please Enter Your Login ID")
		s.Admin.focus();
		return false
	}
	if(s.pw.value=="")
	{
		alert("Please Enter Your Password")
		s.pw.focus();
		return false
	}
}
 
function adm_topcat_validate(s)
{
	if(s.MainCategory.value == "")
	{
		alert("Please Select Main Category Name.");
		s.MainCategory.focus();
		return false;
	}
	if(s.Category2.value == "")
	{
		alert("Please Select Middle Category Name.");
		s.Category2.focus();
		return false;
	}

	if(trim(s.cat_name.value)=="")
	{
		alert("Please Enter Category Name.")
		s.cat_name.focus()
		return false
	}else
	{
		if(!fnCheckCatGeneralRule(s.cat_name.value))
		{
			alert("Category Name should be Alphanumeric with (',&_)");
			s.cat_name.focus()
			return false
		}
	}
}
function adm_midgift_cat_validate(s)
{
	//alert(document.cate.select5.value);
	if(s.select5.value == "")
	{
		alert("Please Select Top Category Name.");
		s.select5.focus();
		return false;
	}
	
	if(trim(s.cat_name.value)=="")
	{
		alert("Please Enter Category Name.")
		s.cat_name.focus()
		return false
	}else
	{
		if(!fnCheckCatGeneralRule(s.cat_name.value))
		{
			alert("Category Name should be Alphanumeric with (',&_)");
			s.cat_name.focus()
			return false
		}
	}
}

function giftlistboxItemSelected(oList1,oList2) //Added by Blesy on 19/02/2009
{
	music1=document.getElementById("music")
	if(oList1.value == 1)
	{
		/*if(real!=null)
		auto.style.display = ""
		if(real!=null)
		real.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 1
		add_prod.case1.value = 1
		add_prod.ListingDuration.options[4] =  new Option('14 days', '14')*/
	}
	else if(oList1.value == 11)
	{
		/*if(real!=null)
		real.style.display = ""
		if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 2
		add_prod.case1.value = 11
		add_prod.ListingDuration.options[4] =  new Option('14 days', '14')*/
	}
	else if(oList1.value == 23)
	{
		/*if(real!=null)
		real.style.display = "none"
		if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
			music.style.display = ""
		add_prod.flag.value = 3*/
	}
	else
	{
		/*if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
		real.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 0
		add_prod.case1.value = 0
		if (add_prod.extra.value!=""){
			add_prod.ListingDuration.options[4] =  new Option('10 days ($ '+add_prod.extra.value+' fee)', '10')
		}*/
	}	
	id="";	
	if (oList2!=null)
	{
		clearComboOrList(oList2);	
		if (oList1.selectedIndex == -1)
		{
			oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
		} 
		else 
		{
			//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
			fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
			//alert(getvalue(oList1,k));
		}
	}
}
//---------------> list box function <-----------------------

function listboxItemSelected(oList1,oList2)
{
	music1=document.getElementById("music")
	if(oList1.value == 1)
	{
		if(real!=null)
		auto.style.display = ""
		if(real!=null)
		real.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 1
		add_prod.case1.value = 1
		add_prod.ListingDuration.options[4] =  new Option('14 days', '14')
	}
	else if(oList1.value == 11)
	{
		if(real!=null)
		real.style.display = ""
		if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 2
		add_prod.case1.value = 11
		add_prod.ListingDuration.options[4] =  new Option('14 days', '14')
	}
	else if(oList1.value == 23)
	{
		if(real!=null)
		real.style.display = "none"
		if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
			music.style.display = ""
		add_prod.flag.value = 3
	}
	else
	{
		if(auto!=null)
		auto.style.display = "none"
		if(music1!=null)
		real.style.display = "none"
		if(music1!=null)
			music.style.display = "none"
		add_prod.flag.value = 0
		add_prod.case1.value = 0
		if(add_prod.extra != undefined)
		{
			if (add_prod.extra.value!=""){
				add_prod.ListingDuration.options[4] =  new Option('10 days ($ '+add_prod.extra.value+' fee)', '10')
			}
		}
	}

	id="";

	if (oList2!=null)
	{
		clearComboOrList(oList2);
	
		if (oList1.selectedIndex == -1)
		{
			oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
		} 
		else 
		{
			//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
			fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
			//alert(getvalue(oList1,k));
		}
	}
}


function listboxItemSelected1(oList1,oList2)
{
	id="";
	
	if (oList2!=null){
	clearComboOrList(oList2);
	
	if (oList1.selectedIndex == -1){
	oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
	} else {
	//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
		fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
	//alert(getvalue(oList1,k));
	}
	}
}


function clearComboOrList(oList)
{
	//alert(oList.options.length)
	for (var i = oList.options.length - 1; i >= 0; i--)
	{
		oList.options[i] = null;
	}
	oList.selectedIndex = -1;
	//if (oList.onchange)	oList.onchange();
}

function fillListbox(oList, vValue){

if (vValue != '') {
if (assocArray[vValue]){
var arrX = assocArray[vValue];
for (var i = 0; i < arrX.length; i = i + 2){
if (arrX[i] != 'EOF') 
{
	s1=arrX[i + 1];
	oList.options[oList.options.length] = new Option(s1.replace("&#39","'"), arrX[i]);
}
}
//alert (oList.options.length)
if (oList.options.length == 1){
//oList.selectedIndex=0;
//if (oList.onchange)	oList.onchange();
}
} else { oList.options[0] = new Option('No Subcategories', '');
}
}
}


function listboxItemSelected_categoryprop(oList1,oList2)
{
	id="";
	
	if (oList2!=null)
	{
		clearComboOrList(oList2);
	
		if (oList1.selectedIndex == -1)
		{
			oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
		} 
		else 
		{
			//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
			fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
			//alert(getvalue(oList1,k));
		}
	}
}

///////////////////////////// all admin panel functions ending///////////////////////////////////

/////////////////////////////// all general side function//////////////////////////////

function validate_browse(k)
{
if(trim(k.brw.value)=="")
{
alert("Please enter Search text");
k.brw.focus();
return false;
} else
{
location.href ="search_items.php?s_text="+k.brw.value;
}
}

function location_change(sid,k)
{
//alert(sid);
var sort_r=k.value;
location.href ="?id="+sid+"&sort_r="+sort_r;

}

function validate_sort(k)
{ 
var sort_r=k.sort_k.value;
var id=k.id.value;
var level=k.level.value;
var p_type=k.p_type.value;
var frid=k.frid.value;
location.href ="?id="+id+"&level="+level+"&p_type="+p_type+"&frid="+frid+"&search="+k.search.value+"&sort_r="+sort_r;
//return true;

}


function validate_askseller(k)
{
	if(trim(k.name.value)=="")
	 {
	 	alert("Please Enter Name")
		k.name.focus();
		return false;
	 }

	if(trim(k.mailid.value)=="")
	 {
	 	alert("Please Enter Email Address")
		k.mailid.focus();
		return false;
	 }
	  else
	{
					st=k.mailid.value;
					if(checkEmail(st)==false)
					{
						alert("Please Enter Correct Email")
						k.mailid.focus();
						return false;
					}
		}
	
	 if(trim(k.msg.value)=="")
	 {
	 	alert("Please Enter your query")
		k.msg.focus();
		return false;
	 }
	  if(trim(k.security_code.value)=="")
	 {
	 	alert("Please Enter Security code")
		k.security_code.focus();
		return false;
	 }
}

function validate_error(k)
{
	if(trim(k.txtFriend.value)=="")
	 {
	 	alert("Please Enter E-Mail ID")
		k.txtFriend.focus();
		return false;
	 }
	  else
	{
					st=k.txtFriend.value;
					if(checkEmail(st)==false)
					{
						alert("Please Enter Correct Email")
						k.txtFriend.focus();
						return false;
					}
		}
	
	 if(trim(k.description.value)=="")
	 {
	 	alert("Please Enter Description")
		k.description.focus();
		return false;
	 }

}


function validate_favorite(t,t2){
	if(!t) return;
	else if (!(t2.login.value==""))
	{
		MM_openBrWindow(t,'AddList','width=300,height=450');
	}
	else
	{
		alert("To add wish list you have to login");
		location.href = "signin.php";//?frm=auction_product_detail_display.php?p_id="+t2.p_id.value;
		//MM_openBrWindow(t,'AddList','width=300,height=450');
		//return true;
	}
}

function send_friend(k)
{
	 if(trim(k.txtFriend.value)=="")
	 {
	 	alert("Please Enter Email Address")
		k.txtFriend.focus();
		return false;
	 }
	  else
	{
					st=k.txtFriend.value;
					if(checkEmail(st)==false)
					{
						alert("Please Enter Correct Email")
						k.txtFriend.focus();
						return false;
					}
		}

	 if(trim(k.description.value)=="")
	 {
	 	alert("Please Enter Message")
		k.description.focus();
		return false;
	 }

}

function admin_submitvalidate(s){
	if(trim(s.userid.value)==""){
		alert("please enter userid")
		s.userid.focus()
		return false
	}
	if(trim(s.password.value)==""){
		alert("please enter password")
		s.password.focus()
		return false
	}
	if(trim(s.confirmpassword.value)==""){
		alert("please enter confirm password")
		s.confirmpassword.focus()
		return false
	}
	if(trim(s.confirmpassword.value)!=s.password.value){
		alert("password and confirm password")
		s.confirmpassword.focus()
		return false
	}

}
function admin_pagevalidate(p)
{
if(trim(p.page_name.value)==""){
	alert("Please enter page name")
	p.page_name.focus()
	return false
	}
if(trim(p.page_text.value)==""){
	alert("Please enter text")
	p.page_text.focus()
	return false
	}
if(trim(p.status.value)==""){
	alert("Please enter status")
	return false
}
}
/**********Admin login Page************/
function submit_validatea(regform)
{
		
	flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 }
	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Address")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {	
	 
	 	 if(regform.country.value=="USA"){
			 if(regform.state.value==""){				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			 }
			 
		 }else if(regform.country.value=="Ghana"){
			 
			 if(regform.state1.value==""){				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }else{
			 regform.state2.focus();
		 	 alert("Please Enter State Name")			
			 return false
		 }
	 
	 	/*
	 
	 	if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state2.focus();
		 	alert("Please Enter State Name")			
		}
		if(document.getElementById("state2").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state.focus();
		 	alert("Please Select State Name")			
		}
		if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("state2").style.display=='none'){
			regform.state1.focus();		
		 	alert("Please Select State Name")	
		}
		return false
		*/
	 }
/*	if(trim(regform.zip.value)=="")
	 {
	 	alert("Please Enter Zip Code")
		regform.zip.focus();
		return false
	 }
	if (checkNum(regform.zip.value)!=true)
	{
		alert("Please Enter Correct Zip Code")
		regform.zip.focus();
		return false
	} */
	/*if(regform.country.value=="USA"){
		var s=regform.zip.value;
		if (s.length!=5)
		{
			alert("Please Enter Correct Zip Code")
			regform.zip.focus();
			return false
		}
	}*/
		 
	if(trim(regform.email.value)=="")
	 {
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	 else
	{
			st=regform.email.value;
			if(checkEmail(st)==false)
			{
				alert("Please Enter Correct Email")
				regform.email.focus();
				return false
			}
	}
	if(trim(regform.day.value)=="")
	 {
		alert("Please Select Day")
		regform.day.focus();
		return false
	 }
	 if(trim(regform.month.value)=="")
	 {
		alert("Please Select Month")
		regform.month.focus();
		return false
	 }
	 if(trim(regform.year.value)=="")
	 {
		alert("Please Select year")
		regform.year.focus();
		return false
	 }
	 if(a2 == 'NaN')
	{
		
		alert("Please enter valid Day/Month/Year.");
	
		regform.day.focus();
		return false; 
	}else
	{
			 if(a2<18)
			{	
				alert("Sorry, You are Under-aged, you cannot proceed further");
				//}
				regform.day.focus();
				return false; 
			}
			else
			{
				regform.age.value=a2
				
			}
	}
	
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}
}

/**************************************/
function submit_validateb(regform)
{
		
	flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 }
	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Address")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {	
	 
	 	 if(regform.country.value=="USA"){
			 if(regform.state.value==""){				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			 }
			 
		 }else if(regform.country.value=="Ghana"){
			 
			 if(regform.state1.value==""){				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }else{
			 regform.state2.focus();
		 	 alert("Please Enter State Name")			
			 return false
		 }
	 
	 	/*
	 
	 	if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state2.focus();
		 	alert("Please Enter State Name")			
		}
		if(document.getElementById("state2").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state.focus();
		 	alert("Please Select State Name")			
		}
		if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("state2").style.display=='none'){
			regform.state1.focus();		
		 	alert("Please Select State Name")	
		}
		return false
		*/
	 }
/*	if(trim(regform.zip.value)=="")
	 {
	 	alert("Please Enter Zip Code")
		regform.zip.focus();
		return false
	 }
	if (checkNum(regform.zip.value)!=true)
	{
		alert("Please Enter Correct Zip Code")
		regform.zip.focus();
		return false
	} */
	/*if(regform.country.value=="USA"){
		var s=regform.zip.value;
		if (s.length!=5)
		{
			alert("Please Enter Correct Zip Code")
			regform.zip.focus();
			return false
		}
	}*/
		 
	if(trim(regform.email.value)=="")
	 {
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	 else
	{
			st=regform.email.value;
			if(checkEmail(st)==false)
			{
				alert("Please Enter Correct Email")
				regform.email.focus();
				return false
			}
	}
	if(trim(regform.day.value)=="")
	 {
		alert("Please Select Day")
		regform.day.focus();
		return false
	 }
	 if(trim(regform.month.value)=="")
	 {
		alert("Please Select Month")
		regform.month.focus();
		return false
	 }
	 if(trim(regform.year.value)=="")
	 {
		alert("Please Select year")
		regform.year.focus();
		return false
	 }
	 if(a2<18)
	{
		
		alert("Sorry, You are Under-aged, you cannot proceed further");
		//}
		regform.day.focus();
		return false; 
	}
	else
	{
		regform.age.value=a2
		
	}
	/*
	 if(regform.phone1.value=="")
	 {
		alert("Please Enter Phone")
		regform.phone1.focus();
		return false
	 }	  
	 else
	 {
	 	 if (checkNum(regform.phone1.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone1.focus();
			return false
		}
	 }
	 if (checkNum(regform.phone2.value)!=true)
	{
		alert("Please Enter Valid Phone No.")
		regform.phone2.focus();
		return false
	}
	*/
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	 if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter User ID")
		regform.userid.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.userid.value;
		
		if (s.length<=5)
		{
			alert("User ID should have min. '6' characters")
			regform.userid.focus();
			return false
		}
		if(s.match(" "))
		{
			alert("User ID should not have spaces")
			regform.userid.focus();
			return false; 
		}
		
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.userid.value)) { alert("Please enter a valid User ID"); regform.userid.focus(); return false}
	 }
	 if(trim(regform.password.value)=="")
	 {
		alert("Please Enter Password")
		regform.password.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.password.value;
		if (s.length<=5)
		{
			alert("Password should have min. '6' characters")
			regform.password.focus();
			return false
		}
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.password.value)) { alert("Please enter a valid Password"); regform.password.focus(); return false}
	 }
	if(trim(regform.confirmpassword.value)=="")
	 {
		alert("Please Confirm Password")
		regform.confirmpassword.focus();
		return false
	 }
	if(regform.password.value!=regform.confirmpassword.value)
	 {
		alert("Password and Confirm Password are not Same")
		regform.confirmpassword.focus();
		return false
	 }
	 
    if(trim(regform.s_answer.value)=="")
	 {
		alert("Please Enter Answer for Secret Question")
		regform.s_answer.focus();
		return false
	 }
	
	
	
}
/**********User login page************/
function submit_validate(regform)
{
	
	flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 }
	if(trim(regform.address.value)=="")
	 {
		alert("Please Enter Address")
		regform.address.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(regform.country.value=="")
	 {
		alert("Please Select country Name")
		regform.country.focus();
		return false
	 }

	 if(trim(regform.state2.value)=="")
	 {	
	 
	 	 if(regform.country.value=="USA"){
			 if(regform.state.value==""){				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			 }
			 
		 }else if(regform.country.value=="Ghana"){
			 
			 if(regform.state1.value==""){				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }else{
			 regform.state2.focus();
		 	 alert("Please Enter State Name")			
			 return false
		 }
	 
	 	/*
	 
	 	if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state2.focus();
		 	alert("Please Enter State Name")			
		}
		if(document.getElementById("state2").style.display=='none' && document.getElementById("OptGhana").style.display=='none'){
			regform.state.focus();
		 	alert("Please Select State Name")			
		}
		if(document.getElementById("OptUSA").style.display=='none' && document.getElementById("state2").style.display=='none'){
			regform.state1.focus();		
		 	alert("Please Select State Name")	
		}
		return false
		*/
	 }
/*	if(trim(regform.zip.value)=="")
	 {
	 	alert("Please Enter Zip Code")
		regform.zip.focus();
		return false
	 }
	if (checkNum(regform.zip.value)!=true)
	{
		alert("Please Enter Correct Zip Code")
		regform.zip.focus();
		return false
	} */
	/*if(regform.country.value=="USA"){
		var s=regform.zip.value;
		if (s.length!=5)
		{
			alert("Please Enter Correct Zip Code")
			regform.zip.focus();
			return false
		}
	}*/
		 
	if(trim(regform.email.value)=="")
	 {
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	 else
	{
			st=regform.email.value;
			if(checkEmail(st)==false)
			{
				alert("Please Enter Correct Email")
				regform.email.focus();
				return false
			}
	}
	if(trim(regform.day.value)=="")
	 {
		alert("Please Select Day")
		regform.day.focus();
		return false
	 }
	 if(trim(regform.month.value)=="")
	 {
		alert("Please Select Month")
		regform.month.focus();
		return false
	 }
	 if(trim(regform.year.value)=="")
	 {
		alert("Please Select year")
		regform.year.focus();
		return false
	 }
	 if(a2<18)
	{
		
		alert("Sorry, You are Under-aged, you cannot proceed further");
		//}
		regform.day.focus();
		return false; 
	}
	else
	{
		regform.age.value=a2
		
	}
	/*
	 if(regform.phone1.value=="")
	 {
		alert("Please Enter Phone")
		regform.phone1.focus();
		return false
	 }	  
	 else
	 {
	 	 if (checkNum(regform.phone1.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.phone1.focus();
			return false
		}
	 }
	 if (checkNum(regform.phone2.value)!=true)
	{
		alert("Please Enter Valid Phone No.")
		regform.phone2.focus();
		return false
	}
	*/
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	 if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter User ID")
		regform.userid.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.userid.value;
		
		if (s.length<=5)
		{
			alert("User ID should have min. '6' characters")
			regform.userid.focus();
			return false
		}
		if(s.match(" "))
		{
			alert("User ID should not have spaces")
			regform.userid.focus();
			return false; 
		}
		
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.userid.value)) { alert("Please enter a valid User ID"); regform.userid.focus(); return false}
	 }

 
 if(trim(regform.password.value)=="")
	 {

		alert("Please Enter Password")
		regform.password.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.password.value;
		if (s.length<=5)
		{
			alert("Password should have min. '6' characters")
			regform.password.focus();
			return false
		}
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.password.value)) { alert("Please enter a valid Password"); regform.password.focus(); return false}
	 }
	if(trim(regform.confirmpassword.value)=="")
	 {
		alert("Please Confirm Password")
		regform.confirmpassword.focus();
		return false
	 }
	if(regform.password.value!=regform.confirmpassword.value)
	 {
		alert("Password and Confirm Password are not Same")
		regform.confirmpassword.focus();
		return false
	 }
	 
   /* if(trim(regform.s_answer.value)=="")
	 {
		alert("Please Enter Answer for Secret Question")
		regform.s_answer.focus();
		return false
	 }*/
	
	 if(trim(regform.userdigit.value)=="")
	 {
		alert("Please Enter Security Number")
		regform.userdigit.focus();
		return false
	 }
	 
	 if(regform.terms.checked==false)
	 {
	 	alert("To Register You have to Accept Our Terms & Conditions")
		return false
	 } 
		
}


function submit_validate_buyer(regform)
{	
	flg= true;
		//clrflds(regform);
	day=regform.day.value;
	month=regform.month.value;
	year=regform.year.value;

	date=year+"-"+month+"-"+day;
	regform.dateofbirth.value=date;
	a2=DiffYD(trim(regform.dobvalidate.value),date)

	 if(trim(regform.firstname.value)=="")
	 {	
	 	alert("Please Enter First Name")
		regform.firstname.focus();
		return false
	 }
	 if(trim(regform.lastname.value)=="")
	 {
		alert("Please Enter Last Name")
		regform.lastname.focus();
		return false
	 }
	if(trim(regform.street.value)=="")
	 {
		alert("Please Enter Address")
		regform.street.focus();
		return false
	 }
	if(trim(regform.city.value)=="")
	 {
		alert("Please Enter City Name")
		regform.city.focus();
		return false
	 }
	 if(trim(regform.state2.value)=="")
	 {	
	 	if(regform.country.value=="USA")
		{
			if(regform.state.value=="")
			{				 
				regform.state.focus();
		 		alert("Please Select State Name")				
				return false
			 }
			 
		 }
		else if(regform.country.value=="Ghana")
		{ 
			if(regform.state1.value=="")
			{				 
				regform.state1.focus();
		 		alert("Please Select State Name")			
				return false
			 }
			 
		 }
		else
		{
			 regform.state2.focus();
		 	 alert("Please Enter State Name")			
			 return false
		 } 
	 }		 
	if(trim(regform.email.value)=="")
	 {
	 	alert("Please Enter Email")
		regform.email.focus();
		return false
    }
	else
	{
		st=regform.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email.focus();
			return false
		}
	}
	if(trim(regform.day.value)=="")
	 {
		alert("Please Select Day")
		regform.day.focus();
		return false
	 }
	 if(trim(regform.month.value)=="")
	 {
		alert("Please Select Month")
		regform.month.focus();
		return false
	 }
	 if(trim(regform.year.value)=="")
	 {
		alert("Please Select year")
		regform.year.focus();
		return false
	 }
	 if(a2<18)
	{
		alert("Sorry, You are Under-aged, you cannot proceed further");	
		regform.day.focus();
		return false; 
	}
	else
	{
		regform.age.value=a2
		
	}	
	 if(regform.age.value=="")
	 {
		alert("Please Enter Age")
		regform.age.focus();
		return false
	 }
	if (checkNum(regform.age.value)!=true)
	{
		alert("Please Valid Age")
		regform.age.focus();
		return false
	}

	 if(trim(regform.userid.value)=="")
	 {
		alert("Please Enter User ID")
		regform.userid.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.userid.value;		
		if (s.length<=5)
		{
			alert("User ID should have min. '6' characters")
			regform.userid.focus();
			return false
		}
		if(s.match(" "))
		{
			alert("User ID should not have spaces")
			regform.userid.focus();
			return false; 
		}		
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.userid.value)) { alert("Please enter a valid User ID"); regform.userid.focus(); return false}
	 }

 
 if(trim(regform.password.value)=="")
	 {

		alert("Please Enter Password")
		regform.password.focus();
		return false
	 }
	 else
	 {
	 	var s=regform.password.value;
		if (s.length<=5)
		{
			alert("Password should have min. '6' characters")
			regform.password.focus();
			return false
		}
		var re = /^[A-Za-z]\w{5,}$/;
		
		if (!re.test(regform.password.value)) { alert("Please enter a valid Password"); regform.password.focus(); return false}
	 }
	if(trim(regform.confirmpassword.value)=="")
	 {
		alert("Please Confirm Password")
		regform.confirmpassword.focus();
		return false
	 }
	if(regform.password.value!=regform.confirmpassword.value)
	 {
		alert("Password and Confirm Password are not Same")
		regform.confirmpassword.focus();
		return false
	 }
	 
    if(trim(regform.s_answer.value)=="")
	 {
		alert("Please Enter Answer for Secret Question")
		regform.s_answer.focus();
		return false
	 }
	
	/* if(trim(regform.userdigit.value)=="")
	 {
		alert("Please Enter Security Number")
		regform.userdigit.focus();
		return false
	 }*/
	 
	 if(regform.terms.checked==false)
	 {
	 	alert("To Register You have to Accept Our Terms & Conditions")
		return false
	 } 		
}






function USAchck(regform)
{
	g = regform.country;
	h = g.options[g.selectedIndex].value;
	if (g.options[g.selectedIndex].value=="USA" || g.options[g.selectedIndex].value=="Ghana") 
	{
		regform.state.style.display=""
		regform.state1.style.display=""
		regform.state2.style.display="none"
		if(h=="USA"){
			document.getElementById("OptUSA").style.display="";
			document.getElementById("OptGhana").style.display="none";
			regform.state2.value="";
		}else if(h=="Ghana"){
			document.getElementById("OptUSA").style.display="none";
			document.getElementById("OptGhana").style.display="";
			regform.state2.value="";
		}
	}

	if (g.options[g.selectedIndex].value!="USA" && g.options[g.selectedIndex].value!="Ghana")
	{
		regform.state.style.display="none"
		regform.state1.style.display="none"
		regform.state2.style.display=""
	}
}
function validate_login_new(s)
{
	var $count = 0;
	if(trim(s.userid.value)=="")
	{
		alert("Please Enter UserID")
		s.userid.focus()
		return false
	}
	 else
	 {
	 	var s1=s.userid.value;
		
		if (s1.length<6)
		{
			alert("UserID should have min. '6' characters")
			s.userid.focus();
			return false
		}
	 }
	 if(trim(s.password.value)=="")
	{
		alert("Please Enter Password")
		s.password.focus()
		return false
	}
	 else
	 {
	 	var s1=s.password.value;
		if (s1.length<6)
		{
			alert("Password should have min. '6' characters")
			s.password.focus();
			return false
		}
	 }
	
    /*var total_users = document.getElementsByName('ans[]').length;
		
	for(ii=1;ii<=total_users;ii++)
	{	
		//alert(ii);
		//alert(document.getElementById('ans'+ii).value);
		if((document.getElementById('ans'+ii).value)!="")
			$count = $count+1;				
	}
	 if($count<1)
	{
		alert("Answer a minimum of 1 questions.");
		return false
	}*/		
}
	/*---Function Modified By Megha on 15-June-2010 -------*/
	function fnvalidate_questions()
	{
		var obj = document.login
			 if(obj.ans.value == "")
			{
				alert(" Enter Answer of question.");
				obj.ans.focus();
				return false
			}
	}
/*---Function Commented By Megha on 15-June-2010 -------*/

/*function fnvalidate_questions()
{
	var $count = 0;
	var total_users = document.getElementsByName('ans[]').length;
	for(ii=1;ii<=total_users;ii++)
	{	
		if((document.getElementById('ans'+ii).value)!="")
			$count = $count+1;				
	}
	if($count<1)
	{
		alert(" Enter Answer of question.");
		return false
	}
}*/


/*function validate_security_questions(s)
{
	if(trim(frm_security_questions.userdigit.value)=="")
	 {
		alert("Please Enter Security Number")
		frm_security_questions.userdigit.focus();
		return false
	 }
	total_users = document.getElementsByName('ans[]').length;
	//min_char = document.getElementsByName('min_char[]').length;
	for(ii=1;ii<=total_users;ii++)
	{	
		if((document.getElementById('ans'+ii).value)=="")
		{
			alert("Please enter Answer.");
			document.getElementById('ans'+ii).focus();
			return false
		}
		else
		{
			if((document.getElementById('ans'+ii).value).length < (document.getElementById('min_char'+ii).value) )
			{
				alert("Please enter atleast" + (document.getElementById('min_char'+ii).value) + "characters.");
				return false
			}
		}
	}
}*/

function validate_security_questions(s)
{

	var total_users
	
	total_users = document.getElementById('number').value;
   
	//min_char = document.getElementsByName('min_char[]').length;
	for(i=1;i<=total_users;i++)
	{	
	//	alert(document.getElementById('ans'+i).value);
		if(i==1)
		{
			if((document.getElementById('ans'+i).value)!='')
			{
			var re = /^[0-9]\w{3,3}$/;
			if (!re.test(document.getElementById('ans'+i).value))
			{
					alert("Please enter 4 digit Numeric value");	
					return false;
			}
			/*	if((document.getElementById('ans'+i).value).length != 4)
				{
					alert("Please 4 digit number ");	
						return false;
					 
				}*/
			}
		}
		if((document.getElementById('ans'+i).value)=='')
		{
			alert("Please enter Answer.");
			return false;
		}
		

		else
		{
			if((document.getElementById('ans'+i).value).length < (document.getElementById('min_char'+i).value))
			{
				alert("Please enter at least " + (document.getElementById('min_char'+i).value) + " characters.");
				return false;
			}
		}
	}
	
}
function validate_password(s)
{
	if (trim(s.oldpw.value)=="")
	{
		alert("Enter Old Password")
		s.oldpw.focus();
		return false;
	}

	if (trim(s.newpw.value)=="")
	{
		alert("Enter New Password")
		s.newpw.focus();
		return false;
	}
	 else
	 {
	 	var s1=s.newpw.value;
		if (s1.length<6)
		{
			alert("Password should have min. '6' characters")
			s.newpw.focus();
			return false
		}
	 }

	if (trim(s.confirmpw.value)=="")
	{
		alert("Enter Confirm Passwrod")
		s.confirmpw.focus();
		return false;

	}
	if (s.newpw.value!=s.confirmpw.value)
	{
		alert("Confirm Passwrod should be same with new password")
		s.confirmpw.focus();
		return false;
	}

}

function validate_serach(s)
{
	if(s.cate.value=="0")
	{
		alert("No Categories")
		return false
	}
}

function txtfocus()
{
	buy.buyitnow.focus();
}

// for slide show rotation of the products
current = 0;
/*function next(slideform) 
{
	if (slideform.slide[current+1]) 
	{
		slideform.show.src = slideform.slide[current+1].value;
		slideform.slide.selectedIndex = ++current;
   	}
	else first(slideform);
}*/

//Changes By Lalit on Wednesday, February 11, 2009

function next(slideform) 
{

/*	if(current == 0)
		current = 1;*/

	if (slideform.slide[current+1]) 
	{
		slideform.show.src = slideform.slide[current+1].value;
		slideform.slide.selectedIndex = current++;
   	}
	else first(slideform);
}
function previous(slideform) 
{
	if (current-1 >= 0) 
	{
		slideform.show.src = slideform.slide[current-1].value;
		slideform.slide.selectedIndex = --current;
	}
	else last(slideform);
}
function first(slideform) 
{
	current = 0;
	if(slideform.slide[0] != null)
	{
		slideform.show.src = slideform.slide[0].value;
		slideform.slide.selectedIndex = 0;
	}
}
function last(slideform) 
{
	current = slideform.slide.length-1;
	if( current >= 0)
	{
		slideform.show.src = slideform.slide[current].value;
		slideform.slide.selectedIndex = current;
	}
}
function ap(slideform,text) 
{
	slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
	rotate();
}
function change(slideform,a1,a2,wd,he) 
{
	current = a2;
	slideform.show.width=wd
	slideform.show.height=he
	slideform.show.src = a1;
	
	//alert(slideform.show.)
}

//Added By Lalit On Wednesday, February 11, 2009
function change1(slideform,a1,a2) 
{
	current = a2-1;
	slideform.show.src = a1;
	
	//alert(slideform.show.)
}

function rotate(slideform) 
{
	if (slideform.slidebutton.value == "Stop") 
	{
		current = (current == slideform.slide.length-1) ? 0 : current+1;
		slideform.show.src = slideform.slide[current].value;
		slideform.slide.selectedIndex = current;
		window.setTimeout("rotate()", rotate_delay);
   	}
}
function search_estore_validate(s1)
{
	if(trim(s1.search1.value)=="")
	{
		alert("Enter search key word")
		s1.search1.focus()
		return false
	}
}
function validate_new_extra_plan(frm)
{
	if(frm.fee_type.value == "")
	{
		alert("Enter the Fee Type");
		frm.fee_type.focus()
		return false;
	}
	else if(frm.label.value == "")
	{
		alert("Enter the Label");
		frm.label.focus()
		return false;
	}
	else if(frm.amount.value == "")
	{
		alert("Enter the Amount");
		frm.amount.focus()
		return false;
	}
	else if (isNaN(frm.amount.value))
	{
		alert("Amount should be Numeric");
		frm.amount.value = ""
		frm.amount.focus()
		return false;
	}
	frm.action= "added_new_plan.php?fee_type="+frm.fee_type.value+"&label="+frm.label.value+"&amount="+frm.amount.value;
}

function validate_extra_plan_edit(frm)
{
	if(trim(frm.amount.value) == "")
	{
		alert("Enter the Amount")
		frm.amount.focus()
		return false
	}
	if(allDigitsWithPoint(frm.amount.value)== false){
		alert("Enter Numeric values only")
		frm.amount.value = ""
		frm.amount.focus()
		return false
	}
	/*if(parseFloat(frm.amount.value))
		return true
	else
	{
		alert("Enter Numeric values only")
		frm.amount.value = ""
		frm.amount.focus()
		return false
	}*/
}

function check_bold()
{
	if(add_prod.bold1.value == "yes")
		add_prod.bold1.value = "no"
	else
		add_prod.bold1.value = "yes"
}
function check_featured_prod()
{
	if(add_prod.featuredprod1.value == "yes")
		add_prod.featuredprod1.value = "no"
	else
		add_prod.featuredprod1.value = "yes"
}

function check_featured_iwant()
{
	if(document.add_prod.featuredprod1.value == "yes")
		document.add_prod.featuredprod1.value = "no"
	else
		document.add_prod.featuredprod1.value = "yes"
}

function check_border()
{
	if(add_prod.border1.value == "yes")
		add_prod.border1.value = "no"
	else
		add_prod.border1.value = "yes"
}

function check_highlight()
{
	if(add_prod.highlight1.value == "yes")
		add_prod.highlight1.value = "no"
	else
		add_prod.highlight1.value = "yes"
}
/*
function check_user()
{
	if(ss.login.value == ss.user.value)
	{
		alert("Seller Cannot participate in the Auction")
		return false;
	}
	if((ss.bid_amt.value == "")&&(ss.maxbid.value == "" ))
	{
		alert("Enter the Bid Value or the Max. Bid Value");
		return false;	
	}
	if(isNaN(ss.bid_amt.value))
	{
		alert("Bid Amount should be a Numeric value")
		ss.bid_amt.value = ""
		ss.bid_amt.focus()
		return false;
	}
	if(isNaN(ss.maxbid.value))
	{
		alert("Max. Bid Amount should be a Numeric value")
		ss.maxbid.value = ""
		ss.maxbid.focus()
		return false;
	}
	else
		return true;
}*/
function chkMaxBid(form)
{
	form.bidtype.value ="Review";

	if(form.login.value == "")//Added by Megha on 01-Mar-2010
	{
		alert("Please Login before you participate in the bidding");
		location.href = "signin.php";
		return false;
	}
	if(form.bid_amt.value=='')//Added by Megha on 01-Mar-2010
	{
		alert("Please enter Exact bid amount.");
		form.bid_amt.focus();
		return false;			
	}
	else if(parseFloat(form.bid_amt.value) < parseFloat(form.min_bid.value))//Added by Megha on 01-Mar-2010
	{
		alert("Bid value should be greater than "+form.min_bid.value);
		form.bid_amt.value = "";
		form.bid_amt.focus();
		return false;	
	}
	else if(parseFloat(form.maxbid.value) <= parseFloat(form.min_bid.value))//Added by Megha on 01-Mar-2010
	{
		alert("Please enter max bid amount greater than "+form.min_bid.value);
		form.maxbid.value = "";
		form.maxbid.focus();
		return false;			
	}
	else if(parseFloat(form.maxbid.value) <= parseFloat(form.bid_amt.value))//Added by Megha on 01-Mar-2010
	{
		alert("Please enter max bid amount greater than "+form.bid_amt.value);
		form.maxbid.value = "";
		form.maxbid.focus();
		return false;			
	}
	else if(parseFloat(form.bid_amt.value) <= parseFloat(form.min_bid.value))//Added by Megha on 01-Mar-2010
	{
		alert("Please enter  bid amount greater than "+form.min_bid.value);
		form.bid_amt.value = "";
		form.bid_amt.focus();
		return false;			
	}
	else
	{
	//by megha 03-Mar-2010
		var get_bid =form.bid_amt.value;
		var is_deci=get_bid.indexOf('.');

		if(is_deci != '-1')
		{
			var splitbid = form.bid_amt.value.split(".");
			//alert(splitbid);
			if(splitbid[1] == 'undefined')
			{
				splitbid[1].length = '0';
			}
			
			if(splitbid[1].length > 2)
						{
							alert("Please enter currency format as 1234.00");
							form.bid_amt.value = "";
							form.bid_amt.focus();
							return false;
						}
		}
	}
	if(form.maxbid.value=='')
	{
		alert("Your Max bid amount");
		form.bidtype.value ="Bid";
		form.maxbid.focus();
		return false;			
	}
	else
	{//By Megha
		var get_max =form.maxbid.value;
		var is_deciMax=get_max.indexOf('.');

		if(is_deciMax != '-1')
		{
		var splitmax = form.maxbid.value.split(".");	
		//alert(splitmax);
		if(splitmax[1] == 'undefined')
		{
		splitmax[1].length = 0;
		}
		if(splitmax[1].length > 2)
			{
				alert("Please enter currency format as 1234.00");
				form.maxbid.value = "";
				form.maxbid.focus();
				return false;
			}
		}
	}
	validate_auc(form);
}

function validate_auc(form)
{
		//alert('meghna');
		//alert(form.bid_amt.value);
	if(form.login.value == "")
	{
		alert("Please Login before you participate in the bidding");
		location.href = "signin.php";
		return false;
	}//?frm=auction_product_detail_display.php?p_id="+form.p_id.value

	if(form.login.value!= "")
	{
		if(form.login.value == form.user.value)
		{
			alert("Same seller cannot participate in the Bidding");
			return false;
		}
	}
	if(form.bidAllowed.value=='3' || form.bidAllowed.value=='2')
	{
		if(form.chkGb.value=='0')
		{
			alert('Sorry! Bidding Is Allowed Only For Gb Account Holder With Min Reserve Amount.');
			return false;
		}
		if(form.bidAllowed.value=='3')
		{
			if(form.minGbflag.value=='1')
			{
				var MinGbAmount =parseFloat(form.MinGbAmount.value);
					MinGbAmount = MinGbAmount.toFixed(2);
				alert('Sorry! Minimum GB Deposit To Bid This Product Is '+MinGbAmount+'.');
				return false;
			}
		}

	}
//	if(form.planre.value=='')//this if Condition commented by Megha
//	{

	
		if(form.maxbid.value!="")
		{
			if(form.bid_amt.value=='')
			{
				alert("Enter Bid amount");
				form.bid_amt.focus();
				return false;			
			}
			if(form.bid_amt.value!='')
			{ 
				
				if (checkFloat(form.bid_amt.value)!=true)
				{
					alert("Enter a valid Bid amount");
					form.bid_amt.focus();
					return false;
				}
							//by megha 03-Mar-2010
					var get_bid =form.bid_amt.value;
					var is_deci=get_bid.indexOf('.');

					if(is_deci != '-1')
					{
						var splitbid = form.bid_amt.value.split(".");
						//alert(splitbid);
						if(splitbid[1] == 'undefined')
						{
							splitbid[1].length = '0';
						}
						
						if(splitbid[1].length > 2)
									{
										alert("Please enter currency format as 1234.00");
										form.bid_amt.value = "";
										form.bid_amt.focus();
										return false;
									}
					}
			}
			if(form.maxbid.value!='')
			{ 
				if (checkFloat(form.maxbid.value)!=true)
				{
					alert("Enter a valid Maximum Bid amount");
					form.maxbid.focus();
					return false;
				}
				var get_max =form.maxbid.value;
				var is_deciMax=get_max.indexOf('.');

				if(is_deciMax != '-1')
				{
				var splitmax = form.maxbid.value.split(".");	
				//alert(splitmax);
				if(splitmax[1] == 'undefined')
				{
				splitmax[1].length = 0;
				}
				if(splitmax[1].length > 2)
					{
						alert("Please enter currency format as 1234.00");
						form.maxbid.value = "";
						form.maxbid.focus();
						return false;
					}
				}
				else if(parseFloat(form.maxbid.value) <= parseFloat(form.bid_amt.value))//Added by Megha on 01-Mar-2010
				{
					alert("Please enter max bid amount greater than "+form.bid_amt.value);
					form.maxbid.value = "";
					form.maxbid.focus();
					return false;			
				}
			}
			if(form.bid_amt.value == "" && form.maxbid.value == "")
			{
				alert("Enter the Exact Bid or the Maximum Bid");
				return false;
			}
			else if(parseFloat(form.maxbid.value) < parseFloat(form.min_bid.value))
			{
				alert("Bid value should be greater than "+form.min_bid.value);
				form.maxbid.value = "";
				form.maxbid.focus();
				return false;	
			}
			else if(parseFloat(form.bid_amt.value) < parseFloat(form.min_bid.value))
			{
				alert("Bid value should be atleast "+form.min_bid.value);
				form.bid_amt.value = "";
				form.bid_amt.focus();
				return false;
			}
			if(form.qty)
			{
					if(form.qty.value == "")
					{
						alert("Enter the Quantity");
						form.qty.focus();
						return false;
					}
					else if(form.qty.value <= 0)
					{
						alert("Qunatity entered should be a positive integer");
						form.qty.focus();
						form.qty.value = "";
						return false;
					}
					if(parseInt(form.qty.value) > parseInt(form.qty1.value))
					{
						alert("The Max. Quantity available is "+form.qty1.value+" Re - enter the Quantity");
						form.qty.value = "";
						form.qty.focus();
						return false;
					}
					if(isNaN(form.qty.value))
					{
						alert("Enter an integer value");
						form.qty.value = "";
						form.qty.focus();
						return false;
					}
					else
					{}
				}
				else if(form.numrec.value!='0')
				{
					if(confirm("\t!!W A R N I N G!!\n\n You have been already participated in the bidding.\t\n\n Do you wish to continue?\t\n\n"))
					{
						form.action = "redirect.php";
						form.submit();
						return true;
					}
					return false;
				}
				else
					form.action = "redirect.php";
					form.submit();
					return true;
		}
		else if(form.bid_amt.value == "")
		{
			alert("Enter the Bid amount");
			form.bid_amt.focus();
			return false;
		}
		else if(form.bid_amt.value !="")
		{ 
			if (checkFloat(form.bid_amt.value)!=true)
			{
				alert("Enter a valid Bid amount");
				form.bid_amt.focus();
				return false;
			}	
			//by megha 03-Mar-2010
					var get_bid =form.bid_amt.value;
					var is_deci=get_bid.indexOf('.');

					if(is_deci != '-1')
					{
						var splitbid = form.bid_amt.value.split(".");
						//alert(splitbid);
						if(splitbid[1] == 'undefined')
						{
							splitbid[1].length = '0';
						}
						
						if(splitbid[1].length > 2)
									{
										alert("Please enter currency format as 1234.00");
										form.bid_amt.value = "";
										form.bid_amt.focus();
										return false;
									}
					}
			if(parseFloat(form.bid_amt.value) <= parseFloat(form.min_bid.value))
			{
				alert("Bid value should greater than "+form.min_bid.value);
				form.bid_amt.value = "";
				form.bid_amt.focus();
				return false;
			}
			if(form.qty)
			{
				if(form.qty.value == "")
				{
					alert("Enter the Quantity");
					form.qty.focus();
					return false;
				}
				else if(form.qty.value <= 0)
				{
					alert("Qunatity entered should be a positive integer");
					form.qty.focus();
					form.qty.value = "";
					return false;
				}
				if(parseInt(form.qty.value) > parseInt(form.qty1.value))
				{
					alert("The Max. Quantity available is "+form.qty1.value+" Re - enter the Quantity");
					form.qty.value = "";
					form.qty.focus();
					return false;
				}
				if(!(isInteger(form.qty.value)))
				{
					alert("Enter an integer value");
					form.qty.value = "";
					form.qty.focus();
					return false;
				}				
			}
		}
		if(form.numrec.value!='0')
		{
			if(confirm("\t!!W A R N I N G!!\n\n You have been already participated in the bidding.\t\n\n Do you wish to continue?\t\n\n"))
			{
				form.action = "redirect.php";
				form.submit();
				return true;
			}
			return false;
		}
	//}
	
	//Commented on Monday, April 13, 2009 by lalit
	/*if(form.planre.value!='')
	{
		alert("Please Setup The Plan Before Bidding");
		location.href = "seller/package_renew.php";
		return false;
	}*/

	if(form.login.value!= "")
	{
			if(form.login.value == form.user.value)
			{
				alert("Seller cannot participate in the Bidding");
				return false;
			}
			else
			{
				form.action = "redirect.php";
				form.submit();
				return true;
			}
	}
	form.action = "redirect.php";
	form.submit();
	return true;
}

function validate(form)
{
	if(form.login.value == "")
	{
		alert("Please Login before you participate in the bidding");
		location.href = "signin.php?frm=auction_product_detail_display.php?p_id="+form.p_id.value;
		return false;
	}

	if(form.login.value!= "")
	{
		if(form.login.value == form.user.value)
		{
			alert("Same seller cannot participate in the Bidding");
			return false;
		}
	}
	if(form.bidAllowed.value=='3' || form.bidAllowed.value=='2')
	{
		if(form.chkGb.value=='0')
		{
			alert('Sorry! Bidding Is Allowed Only For Gb Account Holder With Min Reserve Amount.');
			return false;
		}
		if(form.bidAllowed.value=='3')
		{
			if(form.minGbflag.value=='1')
			{
				var MinGbAmount =parseFloat(form.MinGbAmount.value);
					MinGbAmount = MinGbAmount.toFixed(2);
				alert('Sorry! Minimum GB Deposit To Bid This Product Is '+MinGbAmount+'.');
				return false;
			}
		}

	}
	if(form.planre.value=='')
	{
		if(form.maxbid)
		{
			if(form.bid_amt.value=='')
			{
				alert("Enter Bid amount");
				form.bid_amt.focus();
				return false;			
			}
			if(form.bid_amt.value!='')
			{
				if (checkFloat(form.bid_amt.value)!=true)
				{
					alert("Enter a valid Bid amount");
					form.bid_amt.focus();
					return false;
				}
			}
			if(form.maxbid.value!='')
			{
				if (checkFloat(form.maxbid.value)!=true)
				{
					alert("Enter a valid Maximum Bid amount");
					form.maxbid.focus();
					return false;
				}
			}
			if(form.bid_amt.value == "" && form.maxbid.value == "")
			{
				alert("Enter the Exact Bid or the Maximum Bid");
				return false;
			}
			else if(parseFloat(form.maxbid.value) < parseFloat(form.min_bid.value))
			{
				alert("Bid value should be greater than "+form.min_bid.value);
				form.maxbid.value = "";
				form.maxbid.focus();
				return false;	
			}
			else if(parseFloat(form.bid_amt.value) < parseFloat(form.min_bid.value))
			{
				alert("Bid value should be atleast "+form.min_bid.value);
				form.bid_amt.value = "";
				form.bid_amt.focus();
				return false;
			}
			if(form.qty)
			{
					if(form.qty.value == "")
					{
						alert("Enter the Quantity");
						form.qty.focus();
						return false;
					}
					else if(form.qty.value <= 0)
					{
						alert("Qunatity entered should be a positive integer");
						form.qty.focus();
						form.qty.value = "";
						return false;
					}
					if(parseInt(form.qty.value) > parseInt(form.qty1.value))
					{
						alert("The Max. Quantity available is "+form.qty1.value+" Re - enter the Quantity");
						form.qty.value = "";
						form.qty.focus();
						return false;
					}
					if(isNaN(form.qty.value))
					{
						alert("Enter an integer value");
						form.qty.value = "";
						form.qty.focus();
						return false;
					}
					else
					{}
				}
				else if(form.numrec.value!='0')
				{
					if(confirm("\t!!W A R N I N G!!\n\n You have been already participated in the bidding.\t\n\n Do you wish to continue?\t\n\n"))
					{
						form.action = "redirect.php";
						form.submit();
						return true;
					}
					return false;
				}
				else{
					form.action = "redirect.php";
						form.submit();
						return true;
				}
		}
		else if(form.bid_amt.value == "")
		{
			alert("Enter the Bid amount");
			form.bid_amt.focus();
			return false;
		}
		else if(form.bid_amt.value !="")
		{
			/*if(!(isFloat(form.bid_amt.value)))
			{
				alert("Enter float value");
				form.bid_amt.value = "";
				form.bid_amt.focus();
				return false;
			}*/
			if (checkFloat(form.bid_amt.value)!=true)
			{
				alert("Enter a valid Bid amount");
				form.bid_amt.focus();
				return false;
			}	
			if(parseFloat(form.bid_amt.value) < parseFloat(form.min_bid.value))
			{
				alert("Bid value should be atleast "+form.min_bid.value);
				form.bid_amt.value = "";
				form.bid_amt.focus();
				return false;
			}
			if(form.qty)
			{
				if(form.qty.value == "")
				{
					alert("Enter the Quantity");
					form.qty.focus();
					return false;
				}
				else if(form.qty.value <= 0)
				{
					alert("Qunatity entered should be a positive integer");
					form.qty.focus();
					form.qty.value = "";
					return false;
				}
				if(parseInt(form.qty.value) > parseInt(form.qty1.value))
				{
					alert("The Max. Quantity available is "+form.qty1.value+" Re - enter the Quantity");
					form.qty.value = "";
					form.qty.focus();
					return false;
				}
				if(!(isInteger(form.qty.value)))
				{
					alert("Enter an integer value");
					form.qty.value = "";
					form.qty.focus();
					return false;
				}				
			}
		}
		if(form.numrec.value!='0')
		{
			if(confirm("\t!!W A R N I N G!!\n\n You have been already participated in the bidding.\t\n\n Do you wish to continue?\t\n\n"))
			{
				form.action = "redirect.php";
						form.submit();
				return true;
			}
			return false;
		}
	}
	
	//Commented on Monday, April 13, 2009 by lalit
	/*if(form.planre.value!='')
	{
		alert("Please Setup The Plan Before Bidding");
		location.href = "seller/package_renew.php";
		return false;
	}*/

	if(form.login.value!= "")
	{
			if(form.login.value == form.user.value)
			{
				alert("Seller cannot participate in the Bidding");
				return false;
			}
			else
				return true;
	}
	
	return true;
}

/*	else if(!(isNaN(form.bid_amt.value)))
	{
		alert("Bid amount should be Numeric");
		form.bid_amt.focus();
		return false;
	}
	else if(!(isNaN(form.maxbid.value)))
	{
		alert("Max Bid should be Numeric");
		form.maxbid.focus();
		return false;
	}*/

function checklogin(form)
{
	if(form.login.value != "")
	{
		if(form.login.value == form.user.value)
		{
			alert("Seller cannot participate in the Auction");
			return false;
		}
		else
		{
				if(form.bidAllowed.value=='3' || form.bidAllowed.value=='2')
				{
					if(form.chkGb.value=='0')
					{
						alert('Sorry! Only For Gb Account Holder With Min Reserve Amount Can Buy this Product.');
						return false;
					}
					if(form.bidAllowed.value=='3')
					{
						if(form.minGbflag.value=='1')
						{
							var MinGbAmount =parseFloat(form.MinGbAmount.value);
							MinGbAmount = MinGbAmount.toFixed(2);

							alert('Sorry! Minimum GB Deposit To Buy This Product Is '+MinGbAmount+'.');
							return false;
						}
					}

				}
				document.buy.action = "buynow_2.php";
				document.buy.submit();
			//location.href = "buynow_2.php?p_id="+form.p_id.value+"&login="+form.login.value+"&bidpos="+form.bidpos.value+"&qty="+form.qty_text.value;
			return true;
		}
	}
	else
	{
		alert("Please Login before you buy this item");
		location.href = "signin.php?frm=auction_product_detail_display.php?p_id="+form.p_id.value;
		return false;
	}
	return true;
}
// Bidding Process Confirm_bid	

function submit1()
{
	form1.submit.disabled 	=	true;
	if(form1.qty)
	{
		window.location.href = "confirm_bid2.php?qty="+form1.qty.value+"&confirmation_flag="+form1.confirmation_flag.value+"&login="+form1.login.value+"&p_id="+form1.p_id.value+"&margin_price="+form1.margin_price.value+"&min_bid="+form1.min_bid.value+"&maxbid="+form1.maxbid.value+"&bid_amt="+form1.bid_amt1.value;

	}
	else
	{
		window.location.href = "confirm_bid2.php?confirmation_flag="+form1.confirmation_flag.value+"&login="+form1.login.value+"&p_id="+form1.p_id.value+"&margin_price="+form1.margin_price.value+"&min_bid="+form1.min_bid.value+"&maxbid="+form1.maxbid.value+"&bid_amt="+form1.bid_amt1.value;
	}
}
function submit2()
{
	if(parseFloat(form1.high_prxy.value) >= parseFloat(form1.maxbid.value))
	{
		alert("Enter the amount higher than the existing Highest Proxy to proceed further");
		return false
	}	
	else {
		form1.submit.disabled 	=	true;
		window.location.href = "confirm_bid2.php?confirmation_flag="+form1.confirmation_flag.value+"&login="+form1.login.value+"&p_id="+form1.p_id.value+"&margin_price="+form1.margin_price.value+"&min_bid="+form1.min_bid.value+"&maxbid="+form1.maxbid.value;
	}
}
function submit3()
{
	if(parseFloat(form1.high_prxy.value) >= parseFloat(form1.bid_amt.value))
	{
		//alert("Enter the amount that is higher or lesser than the Proxy amount existing in the system");
		alert("Enter the amount higher than the existing Highest Proxy to proceed further");
		return false  
	}	
	else {
		form1.submit.disabled 	=	true;
		window.location.href = "confirm_bid2.php?confirmation_flag="+form1.confirmation_flag.value+"&login="+form1.login.value+"&p_id="+form1.p_id.value+"&margin_price="+form1.margin_price.value+"&min_bid="+form1.min_bid.value+"&bid_amt="+form1.bid_amt.value;
	}
}
function contact_seller()
{
	seller.style.display="";
}
function preview()
{
	if(window.opener.add_prod.MainCategory.value == 1)
	{
		auto.style.display=""
	}
	else if(window.opener.add_prod.MainCategory.value == 11)
	{
		real.style.display=""
	}
}
function auto_preview()
{
	s1 = window.opener.add_prod;
	var str1 ="";
	for (var i=0; i < 2; i++)
		{
			if(s1.two_w[i].checked)	
			{
				if(s1.two_w[i].value == 0){
					str1="Standard"
				}
				else {
					str1="Not available"
				}
			}
			if(s1.four_w[i].checked)	
			{
				if(s1.four_w[i].value == 0){
					str2="Standard"
				}
				else {
					str2="Not available"
				}
			}
			if (s1.front[i].checked)
			{
			  if(s1.two_w[i].value == 0){
					str3="Standard"
				}
				else {
					str3="Not available"
				}
			}
			if (s1.front_rear[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str4="Standard"
				}
				else {
					str4="Not available"
				}
			}
			if (s1.cruise_control[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str5="Standard"
				}
				else {
					str5="Not available"
				}
			}
			if (s1.fm_radio[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str6="Standard"
				}
				else {
					str6="Not available"
				}
			}
			if (s1.cassette[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str7="Standard"
				}
				else {
					str7="Not available"
				}
			}
			if (s1.cd[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str8="Standard"
				}
				else {
					str8="Not available"
				}
			}
			if (s1.cd_changer[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str9="Standard"
				}
				else {
					str9="Not available"
				}
			}
			if (s1.premium_radio[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str10="Standard"
				}
				else {
					str10="Not available"
				}
			}
			if (s1.dvd[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str11="Standard"
				}
				else {
					str11="Not available"
				}
			}
			if (s1.cup_holder[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str12="Standard"
				}
				else {
					str12="Not available"
				}
			}
			if (s1.leather_seats[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str13="Standard"
				}
				else {
					str13="Not available"
				}
			}
			if (s1.navigation_sys[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str14="Standard"
				}
				else {
					str14="Not available"
				}
			}
			if (s1.privacy_glass[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str15="Standard"
				}
				else {
					str15="Not available"
				}
			}
			if (s1.hands_free[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str16="Standard"
				}
				else {
					str16="Not available"
				}
			}
			if (s1.power_locks[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str17="Standard"
				}
				else {
					str17="Not available"
				}
			}
			if (s1.power_outlets[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str18="Standard"
				}
				else {
					str18="Not available"
				}
			}
			if (s1.power_mirror[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str19="Standard"
				}
				else {
					str19="Not available"
				}
			}
			if (s1.remote_mirror[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str20="Standard"
				}
				else {
					str20="Not available"
				}
			}
			if (s1.power_seat[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str21="Standard"
				}
				else {
					str21="Not available"
				}
			}
			if (s1.dual_power[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str22="Standard"
				}
				else {
					str22="Not available"
				}
			}
			if (s1.folding_rear[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str23="Standard"
				}
				else {
					str23="Not available"
				}
			}
			if (s1.moon[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str24="Standard"
				}
				else {
					str24="Not available"
				}
			}
			if (s1.sun[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str25="Standard"
				}
				else {
					str25="Not available"
				}
			}
			if (s1.remote_key[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str26="Standard"
				}
				else {
					str26="Not available"
				}
			}
			if (s1.luggage[i].checked)
			{
			  if(s1.two_w[i].value == 0){
					str27="Standard"
				}
				else {
					str27="Not available"
				}
			}
			if (s1.rear_win[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str28="Standard"
				}
				else {
					str28="Not available"
				}
			}
			if (s1.tilt[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str29="Standard"
				}
				else {
					str29="Not available"
				}
			}
			if (s1.tachometer[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str30="Standard"
				}
				else {
					str30="Not available"
				}
			}
			if (s1.traction[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str31="Standard"
				}
				else {
					str31="Not available"
				}
			}
			if (s1.power_win[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str32="Standard"
				}
				else {
					str32="Not available"
				}
			}
			if (s1.upgraded[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str33="Standard"
				}
				else {
					str33="Not available"
				}
			}
			if (s1.power_steer[i].checked)
			{
				if(s1.two_w[i].value == 0){
					str34="Standard"
				}
				else {
					str34="Not available"
				}
			}
		}
		document.write("2W Anti-Lock Brakes - "+str1);
		document.write(" , 4W Anti-Lock Brakes - "+str2);
		document.write(" , Front Air Conditioning - "+str3);
		document.write(" , Front &amp; Rear Air Conditioning - "+str4);
		document.write(" , Cruise Control - "+str5);
		document.write(" , AM/FM Radio - "+str6);
		document.write(" , Cassette - "+str7);
		document.write(" , Compact Disc - "+str8);
		document.write(" , CD Changer - "+str9);
		document.write(" , Premium Radio - "+str10);
		document.write(" , DVD Entertainment System - "+str11);
		document.write(" , Cup Holder - "+str12);
		document.write(" , Leather seats - "+str13);
		document.write(" , Navigation System - "+str14);
		document.write(" , Privacy Glass - "+str15);
		document.write(" , Hands Free Phone - "+str16);
		document.write(" , Power Locks - "+str17);
		document.write(" , Power Outlets - "+str18);
		document.write(" , Power Mirrors - "+str19);
		document.write(" , Remote Mirrors - "+str20);
		document.write(" , Power Seat - "+str21);
		document.write(" , Dual Power Seats - "+str22);
		document.write(" , Folding Rear Seat - "+str23);
		document.write(" , Moon Roof - "+str24);
		document.write(" , Sun Roof - "+str25);
		document.write(" , Remote Keyless Entry - "+str26);
		document.write(" , Luggage Rack - "+str27);
		document.write(" , Rear Window Defroster - "+str28);
		document.write(" , Tilt Wheel - "+str29);
		document.write(" , Tachometer - "+str30);
		document.write(" , Traction Control - "+str31);
		document.write(" , Power Windows - "+str32);
		document.write(" , Upgraded Wheels - "+str33);
		document.write(" , Power Steering - "+str34);

}
function check_login1(s1,s2,s3,s4)
{
	alert(s4.value)
}
function check_login(sfrm1)  // Modified by Blesy on 20/02/2009
{
	alert("To continue with the shopping cart, you have to login")
	location.href = "signin.php?frm=estore_product_detail_display.php?id="+sfrm1.id.value+"&uid="+sfrm1.uid.value;
}

function checkGbHolder()
{
	var form = document.form2;
	
	if(form.bidAllowed.value=='3' || form.bidAllowed.value=='2')
	{
		if(form.chkGb.value=='0')
		{
			alert('Sorry! Only For Gb Account Holder With Min Reserve Amount Can Buy This Product.');
			return false;
		}
		if(form.bidAllowed.value=='3')
		{
			if(form.minGbflag.value=='1')
			{
				var MinGbAmount =parseFloat(form.MinGbAmount.value);
					MinGbAmount1 = MinGbAmount.toFixed(2);

				alert('Sorry! Minimum GB Deposit To Buy This Product Is '+MinGbAmount1+'.');
				return false;
			}
		}

	}
	return true;
}

/*function check_login() // Commented by Blesy on 20/02/2009
{
	alert("To continue with the shopping cart, you have to login")
//  	frm1.method="post";
	location.href = "signin.php?frm=estore_product_detail_display.php?id="+frm1.id.value+"&uid="+frm1.uid.value;
}*/

/*function shippinp_add()
{
	frm1.method="post";
	frm1.action=frm1.putype.value+"shipping_address.php?id="+frm1.id.value+"&oid="+frm1.oid.value;
	frm1.submit();
}*/
function shippinp_add(sfrm1) // Modified by Blesy on 20/02/2009
{
	sfrm1.method="post";
	sfrm1.action=sfrm1.putype.value+"shipping_address.php?id="+sfrm1.id.value+"&oid="+sfrm1.oid.value;
	sfrm1.submit();
}
function chkqty()
{
	var val1,val2;
	val1 = form1.qty_text.value;
	if(form1.txtQty.value!='')
	{
		if (checkFloat(form1.txtQty.value)!=true)
		{ 
			alert("Enter a Valid Quantity");	
			form1.txtQty.value="";//By Megha on 02-July-2010
			form1.txtQty.focus();
			return false;
		}
		if(!(isInteger(form1.txtQty.value)))
		{
			alert("Please enter integer values only");
			form1.txtQty.focus();
			return false;
		}
	}
	val2 = form1.txtQty.value;
	val2 = val2-val1;
	if(val2 > 0)
	{
		alert(" Max. Quantity available is "+val1);
		form1.txtQty.value="";
		form1.txtQty.focus();
		return false;
	}
	else
	funval1();
		
	return true;
}
function funval1()
{
	var g=form1;
	if(g)
	{
		var r=eval(g.txtrate.value);
		var d=0;
		
		if(g.txtotherff)
		{
			d=eval(g.txtotherff.value);
		}		
		
		if(g.txtQty.value == "" || g.txtQty.value == 0)
		{
			alert("Enter the Quantity");
			g.txtQty.focus();
			return false;
		}	
		else
			var q=eval(g.txtQty.value);
		
		if(g.qty_text.value == "" || g.qty_text.value == 0)
		{
			alert("Quantity not available");
			return false;
		}
		if(q > eval(g.qty_text.value))
		{			
			alert("Max Quantity available is "+g.qty_text.value);
			g.txtQty.focus();
			return false;
		}
		
		var s=0;
		
		if(q > 1)
		{
			var temp2;
			temp2 = q-1;
			charge = (g.add_price.value*temp2);
			charge = (charge)+(g.price.value*1)
			s = charge;
			s=eval(g.txtQty.value-1)*eval(g.add_price.value)+eval(g.first_item.value);
			//alert(s)
		}
		else 
		{
			s=eval(g.txtShip.value);
			
		}
		g.txtcost.value=(r*q);
		g.txtShip.value=Math.round((s)*100)/100;
		//g.txttotal.value=((r*q)+s)+(d/100);
		var ds=0;
		ds=(r*q)/(100/d);
		var ttt=(r*q)+ds+s;
		g.txttotal.value=Math.round(ttt*100)/100;
		g.txtother.value=ds;
		//g.txttotal.value=(r*q)+s+(d/100);
		return true;
	}
	return false;
}

function funval()
{
		var g=form1;
		if(g){
		if(g.txtcost.value=="" || g.txtShip2.value=="" || g.txttotal.value=="")
		{
			alert("click on calculate");
			g.recal.focus();
			document.form1.btnsubmit.disabled=false;
			return false;
		}
		if(g.txtQty.value=="")
		{
			alert("Enter Quantity");
			g.txtQty.focus();
			document.form1.btnsubmit.disabled=false;
			return false;
		}
		if(eval(g.txtQty.value)<=0)
		{
			alert("Enter Atlest one Quantity");
			g.txtQty.focus();
			document.form1.btnsubmit.disabled=false;
			return false;
		}
		if(eval(g.txtQty.value)>0)
		{
			if(eval(g.txtQty.value)>eval(g.qty_text.value))
			{
				alert("Max Quantity Available is "+g.qty_text.value);
				g.txtQty.focus();
				document.form1.btnsubmit.disabled=false;
				return false;
			}
		}
		//if(funval1())
		if(funval23())
			return true;
		else
			return false;
	}
	return false;
}
function funval23()
{
	var g=form1;
	if(g)
	{
		var r=eval(g.txtrate.value);
		var d=0;
		
		if(g.txtotherff)
		{
			d=eval(g.txtotherff.value);
		}		
		
		if(g.txtQty.value == "" || g.txtQty.value == 0)
		{
			alert("Enter the Quantity");
			g.txtQty.value= "" ;//By Megha on 02-July-2010
			g.txtQty.focus();			
			return false;
		}	
		else
			var q=eval(g.txtQty.value);
		
		if(g.qty_text.value == "" || g.qty_text.value == 0)
		{
			alert("Quantity not available");
			return false;
		}
		if(q > eval(g.qty_text.value))
		{			
			alert("Max Quantity available is "+g.qty_text.value);
			g.txtQty.focus();
			return false;
		}		
		var s=0;		
		if(q > 1)
		{
			var temp2;
			temp2 = q-1;
			charge = (g.add_price.value*temp2);
			charge = (charge)+(g.price.value*1)
			s = charge;
			s=eval(g.txtQty.value-1)*eval(g.add_price.value)+eval(g.first_item.value);
		}
		else 
		{
			s=eval(g.txtShip.value);			
		}
		g.txtcost.value=(r*q);
		g.txtShip.value=Math.round((s)*100)/100;
		//g.txttotal.value=((r*q)+s)+(d/100);
		var ds=0;
		ds=(r*q)/(100/d);
		var ttt=(r*q)+ds+s;
		g.txttotal.value=Math.round(ttt*100)/100;
		//g.txtother.value=ds; commented because javascript error.
		//g.txttotal.value=(r*q)+s+(d/100);
		return true;
	}
	return false;
}

function fun123()
{
	var val1,val2;
	if(!(parseInt(form1.txtQty.value)))
	{
		alert("Please enter integer values only");
		form1.txtQty.value = ""
		form1.txtQty.focus()
		return false
	}
	if(form1.txtQty.value == "")
	{
		alert("Enter the Quantity");
		form1.txtQty.focus();
		return false;
	}
	val1 = form1.qty_text.value;
	val2 = form1.txtQty.value;
	val2 = val2-val1;
	if(val2 > 0)
	{
		alert(" Max. available Quantity is "+val1);
		form1.txtQty.value="";
		form1.txtQty.focus();
		return false;
	}
	else
	funval1();
		
	return true;
}
function validate1(frm1)
{
	frm1.action="sellerwise_invoice.php?id="+frm1.id.value
	return true;
}
function inv_validate(s)
{
	var flag=false
	var dids="";
	if (s.slno!=null)
	{
		i=s.slno.length
		if(i>1)
		{
			for(i1=0;i1<i;i1++)
			{
				if(s.slno[i1].checked)
				{
					flag=true
					if(dids=="")
					{
						dids= s.slno[i1].value
					}
					else
					{
						dids= dids+","+ s.slno[i1].value
					}
									
				}
			}
			
		}
		else
		{
			if(s.slno.checked)
			{
				flag=true
				dids= s.slno.value
			}
		}
	}
	if(flag==false)
	{
		alert("Select transactions to raise invoices")
		return false
	}
	else
	{
		s.ids.value=dids
		return true
	}
}
function validate_editlisting(frm)
{
	if(frm.cat_name.value == "")
	{
		alert("Enter the listing fee amount.")
		frm.cat_name.focus()
		return false;
	}
	if(allDigitsWithPoint(frm.cat_name.value)== false){
		alert("Please enter listing fee amount in numeric.")
		frm.cat_name.focus()
		return false
	}
}
function validate_edittrans1(frm)
{
	if(frm.cat_name222.value == "")
	{	
		alert("Enter the plan name")
		frm.cat_name222.focus()
		return false;
	}
	if(frm.cat_name22.value == "")
	{	
		alert("Enter the price range from")
		frm.cat_name22.focus()
		return false;
	}
	if(frm.cat_name23.value == "")
	{
		alert("Enter the price range to")
		frm.cat_name23.focus()
		return false;
	}
	if(frm.cat_name2.value == "")
	{
		//alert("Enter the price range to")
		frm.cat_name2.value="0"
		//return false;
	}
	if(frm.cat_name.value==""){
		frm.cat_name.value="0"
	}
	
}

function validate_edittrans(frm)
{
	if(frm.cat_name22.value == "")
	{	
		alert("Enter the price range from")
		frm.cat_name22.focus()
		return false;
	}
	if(frm.cat_name23.value == "")
	{
		alert("Enter the price range to")
		frm.cat_name23.focus()
		return false;
	}
	if(frm.cat_name2.value == "")
	{
		//alert("Enter the price range to")
		frm.cat_name2.value="0"
		//return false;
	}
	if(frm.cat_name.value==""){
		frm.cat_name.value="0"
	}
	
}
function validate_editcomm(frm)
{
	if(frm.cat_name2.value == "")
	{	
		alert("Enter the Commission Amount")
		frm.cat_name2.focus()
		return false;
	}

	if (checkFloat(frm.cat_name2.value)!=true)
		{ 
			alert("Enter a Valid Amount");
			frm.cat_name2.focus();
			return false;
		}

	if(frm.cat_name.value == "")
	{
		alert("Enter the Discount")
		frm.cat_name.focus()
		return false;
	}
	if (checkFloat(frm.cat_name2.value)!=true)
	{ 
		alert("Enter a Valid Discount");
		frm.cat_name.focus()
		return false;
	}

	else if(eval(frm.cat_name2.value) < eval(frm.cat_name.value))
	{
		alert("Commission Amount should be more than Discount")
		return false;
	}
}
function validate_editinvoice(frm)
{
	if(frm.cat_name2.value == "")
	{	
		alert("Enter the Invoice Amount")
		frm.cat_name2.focus()
		return false;
	}
	else if(frm.cat_name.value == "")
	{
		alert("Enter the Discount")
		frm.cat_name.focus()
		return false;
	}
	else if(eval(frm.cat_name2.value) < eval(frm.cat_name.value))
	{
		alert("Invoice Amount should be more than Discount")
		return false;
	}
}
/*function validate_auctionrelist() //Commented by Blesy on 10/03/2009
{
	var g=window.document.forms[0];
	if(g)
	{
		if(g.product_name.value=="")
		{
			alert("Enter Product Name");
			g.product_name.focus();
			return false;
		}
		/*if(g.textship.value=="") //Commented by Blesy on 17/02/2009
		{
			alert("Enter Shipping Description");
			g.textship.focus();
			return false;
		}*/
		/*if(g.product_cost.value=="") //Code Added by Blesy on 17/02/2009
		{
			alert("Product Cost should not be Zero");
			g.product_cost.focus();
			return false;
		}
		if(g.imagename1.value=="")
		{
			alert("Upload Image Name");
			g.imagename1.focus();
			return false;
		}
		if((g.imagename1.value=="") && (g.imagename2.value=="") && (g.imagename3.value=="") && (g.imagename4.value==""))
		{
			alert("Upload Image File");
			g.margin_price.focus();
			return false;
		}
		if((g.mkdef[0].checked==false) && (g.mkdef[1].checked==false) && (g.mkdef[2].checked==false) && (g.mkdef[3].checked==false))
		{
			alert("Select The Default Image");
			g.mkdef[0].focus();
			return false;
		}
		if(g.minimum_amount.value=="")//Code Added by Blesy on 17/02/2009
		{
			alert("Minimum Amount should not be Zero");
			g.minimum_amount.focus();
			return false;
		}
	}
}*/ 

function validate_auctionrelist() //Modified by blesy on 10/03/2009
{
	var g=window.document.forms[1];
	if(g)
	{
		if(g.product_name.value=="")
		{
			alert("Enter Product Name");
			g.product_name.focus();
			return false;
		}
		if(g.product_cost.value=="" || g.product_cost.value=="0") 
		{
			alert("Product Cost should not be Zero");
			g.product_cost.focus();
			return false;
		}
		if (g.product_cost.value!="")
		{
			if (checkFloat(g.product_cost.value)!=true)
				{ 
					alert("Enter a Valid Price");	
					g.product_cost.focus();
					return false;
				}
		}
		if(g.imagename1.value=="")
		{
			alert("Upload Image Name");
			g.imagename1.focus();
			return false;
		}
		if((g.imagename1.value=="") && (g.imagename2.value=="") && (g.imagename3.value=="") && (g.imagename4.value==""))
		{
			alert("Upload Image File");
			g.margin_price.focus();
			return false;
		}
		if((g.mkdef[0].checked==false) && (g.mkdef[1].checked==false) && (g.mkdef[2].checked==false) && (g.mkdef[3].checked==false))
		{
			alert("Select The Default Image");
			g.mkdef[0].focus();
			return false;
		}
		if(g.Qty.value=="")
 		{
			alert("Enter the Quantity");
			g.Qty.focus();
			return false; 
		}
		if (g.Qty.value=='0')
		{
			alert("Quantity Should Greater Than '0'");
			g.Qty.focus();
			return false; 
		}
		if (g.Qty.value!='0')
		{
			x = allDigits(g.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				g.Qty.focus();
				return false;
			}
		}	
		if(g.minimum_amount.value=="" || g.minimum_amount.value=="0")
		{
			alert("Minimum Amount should not be Zero");
			g.minimum_amount.focus();
			return false;
		}
		if(g.minimum_amount.value!="" || g.minimum_amount.value!="0")
		{
			x = allDigits(g.minimum_amount.value);
			if(x == false)
			{
				alert("Minimum Amount Should be an Integer value");
				g.minimum_amount.focus();
				return false;
			}
		}
		if(g.max_price.value!='' || g.max_price.value!='0')
		{
			x = allDigits(g.max_price.value);
			if(x == false)
			{
				alert("Maximum Price Should be an Integer value");
				g.max_price.focus();
				return false;
			}
		}
		if(g.max_price.value<=g.minimum_amount.value)
	 	{
			alert("Max Price Should Always Greater than Minimum Amount");	
			g.max_price.focus();
			return false; 
		}			
	}	
}

function validate_estorerelist() //Added by blesy on 10/03/2009
{
	var g=window.document.forms[1];
	if(g)
	{
		if(g.product_name.value=="")
		{
			alert("Enter Product Name");
			g.product_name.focus();
			return false;
		}
		if(g.product_cost.value=="" || g.product_cost.value=="0") 
		{
			alert("Product Cost should not be Zero");
			g.product_cost.focus();
			return false;
		}
		if (g.product_cost.value!="")
		{
			if (checkFloat(g.product_cost.value)!=true)
				{ 
					alert("Enter a Valid Price");	
					g.product_cost.focus();
					return false;
				}
		}
		if(g.imagename1.value=="")
		{
			alert("Upload Image Name");
			g.imagename1.focus();
			return false;
		}
		if((g.imagename1.value=="") && (g.imagename2.value=="") && (g.imagename3.value=="") && (g.imagename4.value==""))
		{
			alert("Upload Image File");
			g.margin_price.focus();
			return false;
		}
		if((g.mkdef[0].checked==false) && (g.mkdef[1].checked==false) && (g.mkdef[2].checked==false) && (g.mkdef[3].checked==false))
		{
			alert("Select The Default Image");
			g.mkdef[0].focus();
			return false;
		}
		if(g.Qty.value=="")
 		{
			alert("Enter the Quantity");
			g.Qty.focus();
			return false; 
		}
		if (g.Qty.value=='0')
		{
			alert("Quantity Should Greater Than '0'");
			g.Qty.focus();
			return false; 
		}
		if (g.Qty.value!='0')
		{
			x = allDigits(g.Qty.value);
			if(x == false)
			{
				alert("Quantity Should be an Integer value");
				g.Qty.focus();
				return false;
			}
		}					
	}	
}


function funck(t)
{
	if(t)
	{
		if(t.checked)
		{
			var vb=window.document.forms[1];
			var bh1=vb.mkdef[0].checked;
			var bh2=vb.mkdef[1].checked;
			var bh3=vb.mkdef[2].checked;
			var bh4=vb.mkdef[3].checked;
			if(((t.value=="1") && (vb.imagename1.value==""))  || ((t.value=="2") && (vb.imagename2.value=="")) || ((t.value=="3") && (vb.imagename3.value=="")) || ((t.value=="4") && (vb.imagename4.value=="")))
			{
				t.checked=false;
				alert("First Upload File");
				return;
			}
		}
	}
}
function validate_auctionedit()
{
	var g=window.document.forms[1];	
	
	var oEditor = FCKeditorAPI.GetInstance('textdesc') ;

	if(g)
	{
		if(g.product_name.value=="")
		{
			alert("Enter Product Name");
			g.product_name.focus();
			return false;
		}

		var v1 = oEditor.GetXHTML( true );

		if(oEditor.GetXHTML( true )=="")
		{
			alert("Enter Product Description");
			return false;
		}
		/*if(g.textdesc.value=="")
		{
			alert("Enter Product Description");
			g.textdesc.focus();
			return false;
		}*/
		/*if(g.textship.value=="")
		{
			alert("Enter Shipping Description");
			g.textship.focus();
			return false;
		}*/
		if(g.imagename1.value=="")
		{
			alert("Upload Image Name");
			g.imagename1.focus();
			return false;
		}
		if((g.imagename1.value=="") && (g.imagename2.value=="") && (g.imagename3.value=="") && (g.imagename4.value==""))
		{
			alert("Upload Image File");
			g.margin_price.focus();
			return false;
		}
		if((g.mkdef[0].checked==false) && (g.mkdef[1].checked==false) && (g.mkdef[2].checked==false) && (g.mkdef[3].checked==false))
		{
			alert("Sellect The Default Image");
			g.mkdef[0].focus();
			return false;
		}
		if(g.Qty.value!='' && g.Qty.value!='0')
		{
			if(!(isInteger(g.Qty.value)))
			{
				alert("Enter an integer value");
				g.Qty.focus();
				return false;
			}
			return true;
		}
	}
}
/////// Admin payment gateway Settings
function val_adminpay(form)
{
	location.href = "add_payment_gateway.php?nav=site&sub_nav=manage_pay&pay="+form.paytype.value;
}
function validate_adminpay(form)
{
	if((form.pay.value== "Authorize") || (form.pay.value== "2checkout") || (form.pay.value== "Secpay") || (form.pay.value== "ipayment") || (form.pay.value== "psigate") || (form.pay.value== "Worldpay") || (form.pay.value== "Paypal") || (form.pay.value== "echo_pay") || (form.pay.value== "Cash On Delivery"))
	{
		if(form.login.value == "")
		{
			alert("Enter the login");
			return false;
		}
	}
	else if((form.pay.value== "Check") || (form.pay.value== "Direct"))
	{
		if(form.bankdetails.value == "")
		{
			alert("Enter the bank details");
			form.bankdetails.focus();
			return false;
		}
	}
	else
	{
		if(form.addinfo.value == "")
		{
			alert("Enter the additional information");
			form.addinfo.focus();
			return false;
		}
	}
	return true;
}
function validate_payeditbank()
{
	 var g=window.document.forms[0];
	 if(g.bankdetails.value=="")
	 {
		 alert ("Please enter the Bank Details");
		 g.bankdetails.focus();
		 return false;
	 }
	 return true;
}
function validate_payedit()
{
	 var g=window.document.forms[0];
	 if(g.addinfo.value=="")
	 {
		 alert ("Please enter the additional information");
		 g.addinfo.focus();
		 return false;
	 }
	 return true;
}
function validate1_payedit()
{
	 var g=window.document.forms[0];
	 if(g.login.value=="")
	 {
		 alert ("Please enter login");
		 g.login.focus();
		 return false;
	 }
	 return true;
}
function validate_discountedit(frm)
{
	if(frm.disc.value == "")
	{
		alert("Enter the Discount")
		frm.disc.focus()
		return false
	}
	if(frm.discount_code.value == "")
	{
		alert("Enter Discount Code")
		frm.discount_code.focus()
		return false
	}
	if(isNaN(trim(frm.disc.value)))
	{
		alert("Enter the Discount in Numerics")
		frm.disc.focus()
		return false
	}
	return true
}
function validate_adddiscount(frm)
{
	if(frm.discount.value == "")
	{
		alert("Enter the Discount")
		frm.discount.focus()
		return false
	}
	if(frm.discount_code.value == "")
	{
		alert("Enter Discount Code")
		frm.discount_code.focus()
		return false
	}
	if(!(parseFloat(frm.discount.value)))
	{
		alert("Enter the Discount in Numerics")
		frm.discount.focus()
		return false
	}
	return true
}
function validate_add_deposit(frm)
{
	var obj = document.form1;
	if(obj.userid.value == "")
	{
		alert("Please Select UserId")
		obj.userid.focus()
		return false
	}
	if(trim(obj.cr_oamount.value) == "")
	{
		alert("Enter Amount to be Credited")
		obj.cr_oamount.focus()
		return false
	}
	if(isNaN(parseFloat(obj.cr_oamount.value)))
	{		
		alert("Enter the Credit Amount in Numerics")
		obj.cr_oamount.focus()
		return false
	}

	/*if(parseInt(frm.cr_amount.value) < parseInt(frm.min_amout.value))
	{
		alert("Enter the Credit Amount Greater Than Min Reserved Fee");
		frm.cr_amount.focus();
		return false
	}*/

	if(trim(obj.txtcurrsign.value) == 0)
	{
		alert("Please Select Exchange Rate")
		obj.txtcurrsign.focus()
		return false
	}

	if(trim(obj.cr_date.value) == "")
	{
		alert("Please Select Amount Deposited Date")
		obj.cr_date.focus()
		return false
	}
	if(trim(obj.additional_info.value) == "")
	{
		alert("Enter Additional Information")
		obj.additional_info.focus()
		return false
	}
	
	if(obj.additional_info.value == "Amount Deposited")
	{
		if(obj.usergroup.value == "Buyer")
		{
			alert("Sorry you can deposit amount only in buyer's Gb account.");
			return false;
		}
	}

	/*else
	{
		if(confirm("\t\n Please confirm to proceed...\t\n\nUserId: "+frm.userid.value+"\nAmount to Credit: "+frm.cr_amount.value+"\nExange Rate: "+frm.exrate.value+"\nDeposit Rate: "+frm.cr_date.value+"\nAdditional Information: "+frm.additional_info.value+"\n"))
			return true
	}*/
	
}
function validate_ghanaauction(frm)
{
	if(frm.bid.value == "")
	{
		alert("Enter the Bid")
		frm.bid.focus()
		return false
	}
	if(!(parseFloat(frm.bid.value)))
	{
		alert("Bid amount should be numeric")
		frm.bid.focus()
		return false
	}
}

////////////////// for selecting the country and states

function listboxItemSelectedk(oList1,oList2){
id="";
if (oList2!=null){
clearComboOrList(oList2);
if (oList1.selectedIndex == -1){
oList2.options[oList2.options.length] = new Option('Please select a State', '');
} else {
//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
fillListboxk(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
}
}
}


function listboxItemSelected_general(oList1,ovalue,oList2){
id="";
if (oList2!=null){
clearComboOrList(oList2);
//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
fillListboxk(oList2, oList1 + '=' + ovalue);

}
}

function fillListboxk(oList, vValue){
var ss="aa"
if (vValue != '') {
//document.write(oList)
if (assocArray[vValue]){
var arrX = assocArray[vValue];

for (var i = 0; i < arrX.length; i = i + 2){

if (arrX[i] != 'EOF') 
{
		ss=arrX[i+1];
	oList.options[oList.options.length] = new Option(ss.replace("&#39","'"), arrX[i]);
}
}
//alert (oList.options.length)
if (oList.options.length == 1){
//oList.selectedIndex=0;
if (oList.onchange)	oList.onchange();
}
} else {
		
			oList.options[0] = new Option('No States..', '');
}
}
}

function clearComboOrList(oList){
for (var i = oList.options.length - 1; i >= 0; i--){
oList.options[i] = null;
}
oList.selectedIndex = -1;
if (oList.onchange)	oList.onchange();
}

function fillListbox(oList, vValue){
if (vValue != '') {
if (assocArray[vValue]){
var arrX = assocArray[vValue];
for (var i = 0; i < arrX.length; i = i + 2){
if (arrX[i] != 'EOF') 
{
		s1=arrX[i + 1];
	oList.options[oList.options.length] = new Option(s1.replace("&#39","'"), arrX[i]);
}
}
//alert (oList.options.length)
if (oList.options.length == 1){
//oList.selectedIndex=0;
if (oList.onchange)	oList.onchange();
}
} else {
		
			oList.options[0] = new Option('No Subcategories', '0');
}
}
}

/////// Buyer order confirmation  Friday, January 23, 2009 By Lalit
function fnValidation()
{ //Modified by Megha on 24-DEc-2011
	var g =document.form1;

	if(g.shipMethod.value == "" || g.shipMethod.value == 0)
	{
		alert("Please select shipping method");
		g.shipMethod.focus();
		return false;
	}

	//var opt = document.form1.shipMethod;
	//var optname = (opt.options[opt.selectedIndex].text);
	if(g.shipMethod.value != 0)
	{
			if(g.shipCourierName.value !="In Store Pick-up")
			{
				if(g.firstname.value=="" )
				{
					alert("Enter First Name");
					g.firstname.focus();
					return false;
				}	
				if(g.lastname.value=="" )
				{
					alert("Enter Last Name");
					g.lastname.focus();
					return false;
				}
				if(g.address.value=="" )
				{
					alert("Enter Address");
					g.address.focus();
					return false;
				}
				else if(g.address.value.length>200)
				{
				alert("Max length for address field is 200 characters");
				return false;
				}
				if(g.city.value=="" )
				{
					alert("Enter City");
					g.city.focus();
					return false;
				}
				
			/*	if(g.zip.value=="" )
				{
					alert("Enter Zipcode");
					g.zip.focus();
					return false;
				}*/
				else if(isNaN(g.zip.value))
				{
					alert("Zip Code should be Numeric");
					g.zip.value="";
					g.zip.focus();
					return false;
				}	

				
				if(g.email.value=="")
				 {
					g.email.focus();
					alert("Your Email Address is missing. ");
					return false;
				}
				else
				{
					st=g.email.value;
					if(!checkEmail(st))
					{
						g.email.focus();
						alert("Please Enter a Valid Email");
						return false;
					}
				}

				if(g.phone.value=="" )
				{
					alert("Enter Phone Number");
					g.phone.focus();
					return false;
				}
				else if(isNaN(g.phone.value))
				{
					alert("Phone Number should be Numeric"); //Modified by blesy on 09/02/2009
					g.phone.value ="";
					g.phone.focus();
					return false;
				}
				g.btnSubmit.disabled=true;
				return true;
		}
	}
	g.btnSubmit.disabled=true;
	return true;
}

/////// Shipping address
function funval_ship()
{
	var g=document.form1;
	if(g)
	{
		if(g.firstname.value=="" )
		{
			alert("Enter First Name");
			g.firstname.focus();
			return false;
		}	
		if(g.lastname.value=="" )
		{
			alert("Enter Last Name");
			g.lastname.focus();
			return false;
		}
		if(g.address.value=="" )
		{
			alert("Enter Address");
			g.address.focus();
			return false;
		}

		if(g.city.value=="" )
		{
			alert("Enter City");
			g.city.focus();
			return false;
		}
		
		if(g.zip.value=="" )
		{
			alert("Enter Zipcode");
			g.zip.focus();
			return false;
		}
		else if(isNaN(g.zip.value))
		{
			alert("Zip Code should be Numeric");
			g.zip.value="";
			g.zip.focus();
			return false;
		}			
		if(g.email1.value=="")
		 {
			g.email1.focus();
			alert("Your Email Address is missing. ");
			return false;
		}
		else
		{
			st=g.email1.value;
			if(!checkEmail(st))
			{
				g.email1.focus();
				alert("Please Enter a Valid Email");
				return false;
			}
		}
		if(g.phone.value=="" )
		{
			alert("Enter Phone Number");
			g.phone.focus();
			return false;
		}
		else if(isNaN(g.phone.value))
		{
			alert("Phone should be Numeric");
			g.phone.value ="";
			g.phone.focus();
			return false;
		}								
		return true;
	}
	return false;
}
////////Total Estore Earnings
function scr_estore(val)
{	
	location.href = "estore_total_earning.php?days="+(val);
}
///////Total Auction Earnings
function scr(val)
{	
	location.href = "auction_total_earning.php?days="+(val);
}
////////////////////////////// all general side function ending../////////////////////////


////////////////////////// feedback validation process customer service starts here ////////////////////
function feedback(regform)
{
 	if(trim(regform.name.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter Name")
		regform.name.focus();
		return false
	 }
	  /*
	 if(trim(regform.ga_id.value)=="")
	 {
	// alert("ok")
	 	alert("Please Enter GhanaAuction id ")
		regform.ga_id.focus();
		return false
	 }
	 */
	 if(trim(regform.email.value)=="")
	 {
		alert("Please Enter EmailId")
		regform.email.focus();
		return false
	 }
	 else
	 {
		st=regform.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email.focus();
			return false
		}
	 }
	
	if(trim(regform.issue.value)=="")
	 {
		alert("Please Select the Issue reporting on")
		regform.issue.focus();
		return false
	 }
	 
	if(trim(regform.feedback_msg.value)=="")
	 {
		alert("Please Enter Feedback Message")
		regform.feedback_msg.focus();
		return false
	 }
	if(trim(regform.security_code.value)=="")
	 {
		alert("Please Enter the code provided in the text box")
		regform.security_code.focus();
		return false
	 }
}
////////////////////////// feedback validation process customer service ends here ////////////////////

///////////////////----------contact us validation starts here--------------//////////////////////////
function enquiry_validate(form)
{

	if(trim(form.name.value)=="")
	{
		alert ("Please Enter your Name ");
		form.name.focus();
		return false
	}
	if(trim(form.phone.value)=="")
	{
		alert ("Please Enter Your Phone Number");
		form.phone.focus();
		return false
	}
	a =parseFloat(form.phone.value);
	if(isNaN(a))
	{
		alert ("Enter Digits");
		form.phone.focus();
		return false
	}
	if(trim(form.email.value)=="")
	{
		alert ("Please Enter your Mail Id ");
		form.email.focus();
		return false
	}
	if (EmailCheck(form.email.value)==false)
	{
		alert("Invalid E-mail Address! Please re-enter.");
		form.email.focus()
		return false
	}
	if(trim(form.msg.value)=="")
	{
		alert ("Please Enter Enquiry Details");
		form.msg.focus();
		return false
	}
	if(trim(form.userdigit.value) == "")
	{
		alert("Enter the Security Number");
		form.userdigit.focus();
		return false
	}
}

///////////////////----------contact us validation ends here--------------//////////////////////////


///member verification validation starts here/////////////
function member_ver_validate(form)
{
	if(trim(form.name.value)=="")
	{
		alert ("Please Enter Name");
		form.name.focus();
		return false
	}
	if(trim(form.address.value)=="")
	{
		alert ("Please Enter Address");
		form.address.focus();
		return false
	}
	if(trim(form.email.value)=="")
	{
	 	alert("Please Enter Email")
		form.email.focus();
		return false
    }
	 else
	{
		st=form.email.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			form.email.focus();
			return false
		}
	}
	if(trim(form.ref_name.value)=="")
	{
		alert ("Please Enter Referrer Name");
		form.ref_name.focus();
		return false
	}
	if(trim(form.ref_occupation.value)=="")
	{
		alert ("Please Enter Referrer Occupation");
		form.ref_occupation.focus();
		return false
	}
}
///member verification validation ends here/////////////

	function openNewWindow(path)
	{
		var centerWidth = (window.screen.width - 500) / 2;
		var centerHeight = (window.screen.height - 350) / 2;
		window.open(path,'GhanaAuction', "width=500,height=400, toolbar=no,menubar=no, directories=no,status=no,scrollbars=yes,resizable=yes,left="+centerWidth+",top="+centerHeight);
	}

	function printElement(el){
		if(typeof el === 'string'){
		el = document.getElementById(el);
		if(!el){
				alert('Element doesnt exists');
				return false;
				}					
		}				
		if(!el){
				alert('Element doesnt exists');
				return false;
			}
				
				var content = document.getElementById('prn1').innerHTML;
				var shtm = "<html><head><title>Print</title></head><body>" + content + "</body></html>";
				var w = window.open("","","width=750,height=350");
				w.document.write(shtm);
				w.document.close();
				w.focus();
				w.print();
				w.close();
			}

function fnprint()
{
	window.location.href="seller/print.php";
}

var postState = '';
var postCountry = '';

var state = '\
Ghana:American Samoa:American Samoa|\
Ghana:Ashanti Region:Ashanti Region|\
Ghana:Brong-Ahafo Region:Brong-Ahafo Region|\
Ghana:Central Region:Central Region|\
Ghana:Eastern Region:Eastern Region|\
Ghana:Greater Accra Region:Greater Accra Region|\
Ghana:Northern Region:Northern Region|\
Ghana:Upper East Region:Upper East Region|\
Ghana:Upper West Region:Upper West Region|\
Ghana:Volta Region:Volta Region|\
Ghana:Western Region:Western Region|\
';
var country = '\
Afghanistan:Afghanistan|\
Albania:Albania|\
Algeria:Algeria|\
American Samoa:American Samoa|\
Andorra:Andorra|\
Angola:Angola|\
Anguilla:Anguilla|\
Antarctica:Antarctica|\
Antigua and Barbuda:Antigua and Barbuda|\
Argentina:Argentina|\
Armenia:Armenia|\
Aruba:Aruba|\
Australia:Australia|\
Austria:Austria|\
Azerbaijan:Azerbaijan|\
Azores:Azores|\
Bahamas:Bahamas|\
Bahrain:Bahrain|\
Bangladesh:Bangladesh|\
Barbados:Barbados|\
Belarus:Belarus|\
Belgium:Belgium|\
Belize:Belize|\
Benin:Benin|\
Bermuda:Bermuda|\
Bhutan:Bhutan|\
Bolivia:Bolivia|\
Bosnia And Herzegowina:Bosnia And Herzegowina|\
Bosnia-Herzegovina:Bosnia-Herzegovina|\
Botswana:Botswana|\
Bouvet Island:Bouvet Island|\
Brazil:Brazil|\
British Indian Ocean Territory:British Indian Ocean Territory|\
British Virgin Islands:British Virgin Islands|\
Brunei Darussalam:Brunei Darussalam|\
Bulgaria:Bulgaria|\
Burkina Faso:Burkina Faso|\
Burundi:Burundi|\
Cambodia:Cambodia|\
Cameroon:Cameroon|\
Canada:Canada|\
Cape Verde:Cape Verde|\
Cayman Islands:Cayman Islands|\
Central African Republic:Central African Republic|\
Chad:Chad|\
Chile:Chile|\
China:China|\
Christmas Island:Christmas Island|\
Cocos (Keeling) Islands:Cocos (Keeling) Islands|\
Colombia:Colombia|\
Comoros:Comoros|\
Congo:Congo|\
Congo, The Democratic Republic O:Congo, The Democratic Republic O|\
Cook Islands:Cook Islands|\
Corsica:Corsica|\
Costa Rica:Costa Rica|\
Cote d` Ivoire (Ivory Coast):Cote d` Ivoire (Ivory Coast)|\
Croatia:Croatia|\
Cuba:Cuba|\
Cyprus:Cyprus|\
Czech Republic:Czech Republic|\
Denmark:Denmark|\
Djibouti:Djibouti|\
Dominica:Dominica|\
Dominican Republic:Dominican Republic|\
East Timor:East Timor|\
Ecuador:Ecuador|\
Egypt:Egypt|\
El Salvador:El Salvador|\
Equatorial Guinea:Equatorial Guinea|\
Eritrea:Eritrea|\
Estonia:Estonia|\
Ethiopia:Ethiopia|\
Falkland Islands (Malvinas):Falkland Islands (Malvinas)|\
Faroe Islands:Faroe Islands|\
Fiji:Fiji|\
Finland:Finland|\
France (Includes Monaco):France (Includes Monaco)|\
France, Metropolitan:France, Metropolitan|\
French Guiana:French Guiana|\
French Polynesia:French Polynesia|\
French Polynesia (Tahiti):French Polynesia (Tahiti)|\
French Southern Territories:French Southern Territories|\
Gabon:Gabon|\
Gambia:Gambia|\
Georgia:Georgia|\
Germany:Germany|\
Ghana:Ghana|\
Gibraltar:Gibraltar|\
Greece:Greece|\
Greenland:Greenland|\
Grenada:Grenada|\
Guadeloupe:Guadeloupe|\
Guam:Guam|\
Guatemala:Guatemala|\
Guinea:Guinea|\
Guinea-Bissau:Guinea-Bissau|\
Guyana:Guyana|\
Haiti:Haiti|\
Heard And Mc Donald Islands:Heard And Mc Donald Islands|\
Holy See (Vatican City State):Holy See (Vatican City State)|\
Honduras:Honduras|\
Hong Kong:Hong Kong|\
Hungary:Hungary|\
Iceland:Iceland|\
India:India|\
Indonesia:Indonesia|\
Iran:Iran|\
Iraq:Iraq|\
Ireland:Ireland|\
Ireland (Eire):Ireland (Eire)|\
Israel:Israel|\
Italy:Italy|\
Jamaica:Jamaica|\
Japan:Japan|\
Jordan:Jordan|\
Kazakhstan:Kazakhstan|\
Kenya:Kenya|\
Kiribati:Kiribati|\
Korea, Democratic People\'S Repub:Korea, Democratic People\'S Repub|\
Kuwait:Kuwait|\
Kyrgyzstan:Kyrgyzstan|\
Laos:Laos|\
Latvia:Latvia|\
Lebanon:Lebanon|\
Lesotho:Lesotho|\
Liberia:Liberia|\
Libya:Libya|\
Liechtenstein:Liechtenstein|\
Lithuania:Lithuania|\
Luxembourg:Luxembourg|\
Macao:Macao|\
Macedonia:Macedonia|\
Madagascar:Madagascar|\
Madeira Islands:Madeira Islands|\
Malawi:Malawi|\
Malaysia:Malaysia|\
Maldives:Maldives|\
Mali:Mali|\
Malta:Malta|\
Marshall Islands:Marshall Islands|\
Martinique:Martinique|\
Mauritania:Mauritania|\
Mauritius:Mauritius|\
Mayotte:Mayotte|\
Mexico:Mexico|\
Micronesia, Federated States Of:Micronesia, Federated States Of|\
Moldova, Republic Of:Moldova, Republic Of|\
Monaco:Monaco|\
Mongolia:Mongolia|\
Montserrat:Montserrat|\
Morocco:Morocco|\
Mozambique:Mozambique|\
Myanmar (Burma):Myanmar (Burma)|\
Namibia:Namibia|\
Nauru:Nauru|\
Nepal:Nepal|\
Netherlands:Netherlands|\
Netherlands Antilles:Netherlands Antilles|\
New Caledonia:New Caledonia|\
New Zealand:New Zealand|\
Nicaragua:Nicaragua|\
Niger:Niger|\
Nigeria:Nigeria|\
Niue:Niue|\
Norfolk Island:Norfolk Island|\
Northern Mariana Islands:Northern Mariana Islands|\
Norway:Norway|\
Oman:Oman|\
Pakistan:Pakistan|\
Palau:Palau|\
Palestinian Territory, Occupied:Palestinian Territory, Occupied|\
Panama:Panama|\
Papua New Guinea:Papua New Guinea|\
Paraguay:Paraguay|\
Peru:Peru|\
Philippines:Philippines|\
Pitcairn:Pitcairn|\
Poland:Poland|\
Portugal:Portugal|\
Puerto Rico:Puerto Rico|\
Qatar:Qatar|\
Reunion:Reunion|\
Romania:Romania|\
Russian Federation:Russian Federation|\
Rwanda:Rwanda|\
Saint Kitts And Nevis:Saint Kitts And Nevis|\
San Marino:San Marino|\
Sao Tome and Principe:Sao Tome and Principe|\
Saudi Arabia:Saudi Arabia|\
Senegal:Senegal|\
Serbia-Montenegro:Serbia-Montenegro|\
Seychelles:Seychelles|\
Sierra Leone:Sierra Leone|\
Singapore:Singapore|\
Slovak Republic:Slovak Republic|\
Slovenia:Slovenia|\
Solomon Islands:Solomon Islands|\
Somalia:Somalia|\
South Africa:South Africa|\
South Georgia And The South Sand:South Georgia And The South Sand|\
South Korea:South Korea|\
Spain:Spain|\
Sri Lanka:Sri Lanka|\
St. Christopher and Nevis:St. Christopher and Nevis|\
St. Helena:St. Helena|\
St. Lucia:St. Lucia|\
St. Pierre and Miquelon:St. Pierre and Miquelon|\
St. Vincent and the Grenadines:St. Vincent and the Grenadines|\
Sudan:Sudan|\
Suriname:Suriname|\
Svalbard And Jan Mayen Islands:Svalbard And Jan Mayen Islands|\
Swaziland:Swaziland|\
Sweden:Sweden|\
Switzerland:Switzerland|\
Syrian Arab Republic:Syrian Arab Republic|\
Taiwan:Taiwan|\
Tajikistan:Tajikistan|\
Tanzania:Tanzania|\
Thailand:Thailand|\
Togo:Togo|\
Tokelau:Tokelau|\
Tonga:Tonga|\
Trinidad and Tobago:Trinidad and Tobago|\
Tristan da Cunha:Tristan da Cunha|\
Tunisia:Tunisia|\
Turkey:Turkey|\
Turkmenistan:Turkmenistan|\
Turks and Caicos Islands:Turks and Caicos Islands|\
Tuvalu:Tuvalu|\
Uganda:Uganda|\
Ukraine:Ukraine|\
United Arab Emirates:United Arab Emirates|\
United Kingdom:United Kingdom|\
United States:UnitedStates|\
United States Minor Outlying Isl:United States Minor Outlying Isl|\
Uruguay:Uruguay|\
Uzbekistan:Uzbekistan|\
Vanuatu:Vanuatu|\
Vatican City:Vatican City|\
Venezuela:Venezuela|\
Vietnam:Vietnam|\
Virgin Islands (U.S.):Virgin Islands (U.S.)|\
Wallis and Furuna Islands:Wallis and Furuna Islands|\
Western Sahara:Western Sahara|\
Western Samoa:Western Samoa|\
Yemen:Yemen|\
Yugoslavia:Yugoslavia|\
Zaire:Zaire|\
Zambia:Zambia|\
Zimbabwe:Zimbabwe|\
';

function TrimString(sInString) {
  if ( sInString ) {
    sInString = sInString.replace( /^\s+/g, "" );// strip leading
    return sInString.replace( /\s+$/g, "" );// strip trailing
  }
}

// Populates the country selected with the counties from the country list
function populateCountry(defaultCountry) {
	//alert(country);
  if ( postCountry != '' ) {
    defaultCountry = postCountry;
  }
  var countryLineArray = country.split('|');  // Split into lines
	//alert(countryLineArray.length);
  var selObj = document.getElementById('countrySelect');
  selObj.options[0] = new Option('Select Country','');
  selObj.selectedIndex = 0;
	
  for (var loop = 0; loop < countryLineArray.length-1; loop++) {
    lineArray = countryLineArray[loop].split(':');
    countryCode  = TrimString(lineArray[0]);
    countryName  = TrimString(lineArray[1]);
    if ( countryCode != '' ) {
      selObj.options[loop + 1] = new Option(countryName, countryCode);
    }
    if ( defaultCountry == countryCode ) {
      selObj.selectedIndex = loop + 1;
    }
  }
}

function populateState() {
  var selObj = document.getElementById('stateSelect');
  var foundState = false;
  // Empty options just in case new drop down is shorter
  if ( selObj.type == 'select-one' ) {
    for (var i = 0; i < selObj.options.length; i++) {
      selObj.options[i] = null;
    }
    selObj.options.length=null;
    selObj.options[0] = new Option('Select State','');
    selObj.selectedIndex = 0;
  }
  // Populate the drop down with states from the selected country
  var stateLineArray = state.split("|");  // Split into lines
  var optionCntr = 1;
  for (var loop = 0; loop < stateLineArray.length; loop++) {
    lineArray = stateLineArray[loop].split(":");
    countryCode  = TrimString(lineArray[0]);
    stateCode    = TrimString(lineArray[1]);
    stateName    = TrimString(lineArray[2]);
  if (document.getElementById('countrySelect').value == countryCode && countryCode != '' ) {
    // If it's a input element, change it to a select
      if ( selObj.type == 'text' ) {
        parentObj = document.getElementById('stateSelect').parentNode;
        parentObj.removeChild(selObj);
        var inputSel = document.createElement("SELECT");
        inputSel.setAttribute("name","state");
        inputSel.setAttribute("id","stateSelect");
		inputSel.setAttribute("className","popup-textBox");
        parentObj.appendChild(inputSel) ;
        selObj = document.getElementById('stateSelect');
        selObj.options[0] = new Option('Select State','');
        selObj.selectedIndex = 0;
      }
      if ( stateCode != '' ) {
        selObj.options[optionCntr] = new Option(stateName, stateCode);
      }
      // See if it's selected from a previous post
      if ( stateCode == postState && countryCode == postCountry ) {
        selObj.selectedIndex = optionCntr;
      }
      foundState = true;
      optionCntr++
    }
  }
  // If the country has no states, change the select to a text box
  if ( ! foundState ) {
    parentObj = document.getElementById('stateSelect').parentNode;
    parentObj.removeChild(selObj);
  // Create the Input Field
    var inputEl = document.createElement("INPUT");
    inputEl.setAttribute("id", "stateSelect");
    inputEl.setAttribute("type", "text");
    inputEl.setAttribute("name", "state");
    inputEl.setAttribute("size", 26);
    inputEl.setAttribute("value", postState);
	inputEl.setAttribute("className","popup-textBox");
	
    parentObj.appendChild(inputEl) ;
  }
}
function initCountry(country) {
	//alert('hello');
  populateCountry(country);
	populateState();
}
function fundelete(name)
{
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task1.php?work=subadmindelete&id="+name;
	}
}
function fundelete1(name)
{
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task1.php?work=deletetrans&id="+name;
	}
}
function fundeleterec(name)
{
	//alert(name);
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task1.php?work="+name;
	}
}
function fundeletedis(name)
{
//	alert(name);
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="discount_delete.php?disc_id="+name;
	}
}
function fntrackmail()
{
	if(confirm('Are you sure you want to delete this record(s)?'))
	{
		document.form1.submit()
	}

}
function fundeletelist(name)
{
	//alert(name);
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task1.php?work="+name+"&pfrom=1";
	}
}
function fundeletelist1(name)
{
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task1.php?work="+name+"&pfrom=2";
	}
}
function fundeletesold(name)
{
	
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task.php?work=soldlistingnewdelete&orderid="+name;
	}
}
function funreportdelete(sno)
{
	if(confirm('Are you sure you want to delete this record?'))
	{
		location.href="adm_task.php?work=reportdelete&sno="+sno;
	}

}
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
//alert(document.all["dhtmltooltip"]);
//alert(document.getElementById('dhtmltooltip'));
var tipobj=document.getElementById('dhtmltooltip');

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){

if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor

//alert(thetext)
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible";
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

// Added by Lalit on Wednesday, January 28, 2009
function redirectto(page)
{
	if(document.getElementById("payset").value == "true" && document.getElementById("payset").value != "")
	{
		alert("Please Setup The Payment Settings Before "+page + ".")
		return true;
	}
	if(document.getElementById("shipset").value == "true" && document.getElementById("shipset").value != "")
	{
		alert("Please Setup The Shipping Methods Before "+page + ".")
		return true;
	}
	if(document.getElementById("plan").value == "true" && document.getElementById("plan").value != "")
	{
		alert("Please Setup The Plan Before "+ page + ".")
		return true;
	}
	//Added by Blesy on 29/01/2009
	if(document.getElementById("amount").value == "true" && document.getElementById("amount").value != "")
	{
		var MinDPAmount =parseFloat(document.getElementById("depamount").value);
			MinDPAmount1 = MinDPAmount.toFixed(2);
//		alert("Sorry You Dont Have Enough Money In Deposit Account, Please Contact To Admin Before "+page + ".")
		alert("You should have Minimum Deposit : "+ MinDPAmount1 + " Cedies to add a product in Ghana Auction, Please Deposit Amount.")

		window.location="http://www.ghanaauction.com/credit_acc.php?type=deposit";


		return false;
	} //End
	return true;
}


//Code Added By Sachin Gupta For Print And Submit Functionality
function print_and_submit(regform,t,p)
{
	if(trim(regform.contact_name.value)=="")
	 {
	 	alert("Please Enter Name")
		regform.contact_name.focus();
		return false
	 }
	 if(trim(regform.company_name.value)=="")
	 {
		alert("Please Enter Company Name")
		regform.company_name.focus();
		return false
	 }
	if(trim(regform.postal_address.value)=="")
	 {
		alert("Please Enter Address")
		regform.postal_address.focus();
		return false
	 }
	if(trim(regform.store_office_location.value)=="")
	 {
		alert("Please Enter Office Location")
		regform.store_office_location.focus();
		return false
	 }
	
	 if(regform.off_phone_number.value=="")
	 {
		alert("Please Enter Phone ")
		regform.off_phone_number.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.off_phone_number.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.off_phone_number.focus();
			return false
		}
	 }
	 
	  if(regform.home_phone_number.value=="")
	 {
		alert("Please Enter Phone ")
		regform.home_phone_number.focus();
		return false
	 }	  
	 else
	 {
	 	if (checkNum(regform.home_phone_number.value)!=true)
		{
			alert("Please Enter Valid Phone No.")
			regform.home_phone_number.focus();
			return false
		}
	 }
	
	
	if(trim(regform.email_address.value)=="")
	{
	 	alert("Please Enter Email")
		regform.email_address.focus();
		return false
    }
	 else
	{
		st=regform.email_address.value;
		if(checkEmail(st)==false)
		{
			alert("Please Enter Correct Email")
			regform.email_address.focus();
			return false
		}
	}
	
	if(trim(regform.date_birth.value)=="")
	 {
		alert("Please Enter Birth Date")
		regform.date_birth.focus();
		return false
	 }
	 
	 if(trim(regform.place_birth.value)=="")
	 {
		alert("Please Enter Birth Place")
		regform.place_birth.focus();
		return false
	 }
	 	 
	
	 if(trim(regform.home_town.value)=="")
	 {
		alert("Please Enter Home Town")
		regform.home_town.focus();
		return false
	 }
		
	var fxa=(trim(regform.driver_licence_number.value)=="")?false:true;
	var fxb=(trim(regform.passport_number.value)=="")?false:true;
	var fxc=(trim(regform.voter_card_number.value)=="")?false:true;	
	 if((fxa && fxb) || (fxb && fxc) || (fxc && fxa))
	 {
		
		
		
	 }else{
	  	alert("Please Any Two Drivers license number or Passport number or Voters registration card number  ")
		regform.driver_licence_number.focus();
		return false
	 }
	 
	  if(regform.terms.checked==false)
	  {
	 	alert("For Authentication You have to Accept Our Terms & Conditions")
		return false
	 }  
	 
	 p=p+'seller/print_temp.php';	
	 vg=window.open(p,'test');
	
	/*if(vg)
	{
	 regform.submit();
  	 return true;
  	 }*/
}
function fnMicrochat(path)
{
	window.open(path+'microchat/','Microchat',"width=500,height=600,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no");
}

function fnMicrochatBuyer()
{
	window.open('microchat/','Microchat',"width=500,height=600,left=115,top=20,resizable=yes,scrollbars=yes,titlebar=no");
}

function isInteger(s)
{
	return (s.toString().search(/^-?[0-9]+$/) == 0);
}

function fnValidatePrice(s)
{
	var g=s;
	for(var i=1; i<4; i++)
	{
		if(document.getElementById("ptext_"+i).value =="")
		{
				alert ("Please enter Price.");
				document.getElementById("ptext_"+i).focus();
				return false;	
		}
		if(document.getElementById("ptext_"+i).value!="" || parseInt(document.getElementById("ptext_"+i).value)!=0)
		{
			if(checkFloat(document.getElementById("ptext_"+i).value) != true)
			{
				alert ("Please enter correct Price.");
				document.getElementById("ptext_"+i).focus();
				return false;
			}
		}
        if(document.getElementById("duration_"+i).value == "0")
		{
		alert ("Please select days.");
		document.getElementById("duration_"+i).focus();
		return false;
		}

	}
	if(confirm("Do you really want to Update?"))
		return true;
	else
	{
		for(var i=1; i<4; i++)
		{
			document.getElementById("ptext_"+i).value = document.getElementById("prev_"+i).value;
			document.getElementById("duration_"+i).value = document.getElementById("prev_dura_"+i).value;
		}
		return false;
    }


}
function checkURL(url)
{
	var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;
	if(RegExp.test(url))
	{
		//if(url.indexOf ('www', 0) != -1)
		//{
			return true;
		//}
	}
	else
	{
		return false;
	}
}


function validate_step2_iwant(s1,step3,step2)
{
	if(s1.rdodefault != undefined)
	{
		for(i=0;i<s1.rdodefault.length;i++)
		{
			if(s1.rdodefault[i].checked==true)
			{
				s1.defaultImage.value = s1.rdodefault[i].value;
			}
		}
	}

	if (checkFloat(s1.bidstartamt3.value)!=true)
	{ 
		alert("Enter a Valid Lowest Price");	
		s1.bidstartamt3.focus();
		return false;
	}
	if (trim(s1.Qty.value)=='')
	{ 
		alert("Please Enter Quantity");
		s1.Qty.focus();
		return false;
	}

	if (trim(s1.Qty.value)=='0')
	{ 
		alert("Enter Quantity More Than 0");
		s1.Qty.focus();
		return false;
	}

	if (checkFloat(s1.Qty.value)!=true)
	{ 
		alert("Enter a Valid Quantity");	
		s1.Qty.focus();
		return false;
	}
	s1.checkedS2.value = 1;
	hide_display(step3,step2);
		if(s1.bidstartamt3.value!="")
		{
			var totAmount = s1.bidstartamt3.value;
			s1.totalcost.value = totAmount;
			document.getElementById("totalcost").style.display="";
		}
}

function fnCheckCatGeneralRule(title) {

	var valid="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'&,_ ";
	for (var i=0; i<title.length; i++) {
		if (valid.indexOf(title.charAt(i)) < 0) {
			return false;
		}
	}
	return true;
}
function getImageList()
{

	var url="http://www.ghanaauction.com/image_list.php";

	xmlHttp=GetXmlHttpObject(stateImageList)
	var parameters= "imagefor";
	xmlHttp.open("POST", url, false);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
	xmlHttp.send(parameters)
}
function stateImageList(){

		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById("imagetr").style.display = "";
			document.getElementById("imagediv").innerHTML	=	xmlHttp.responseText;
		}
	}

	//removes the trailing spaces
function trim(pstrString) {
		return pstrString.replace(/^\s+|\s+$/g,"");
	}

	//function for send message for reports
	function fnChkForEmpty()
		{
			if(document.form1.message.value=="")
			{
				alert('Please Enter message.');
				document.form1.message.focus();
				return false;
			}
			else if(trim(document.form1.message.value)=="")
			 {
				alert('Please Enter message.');
				document.form1.message.focus();
				return false;
			 }
			else
				return true;
		}
//function for send report
function fnChkForEmpty_send()
{
	if(document.form1.subject.value=="")
	{
		alert('Please Select subject.');
		document.form1.subject.focus();
		document.form1.btnsubmit.disabled = false;
		return false;
	}
	 if(trim(document.form1.message.value)=="")
	 {
		alert('Please Enter message.');
		document.form1.message.focus();
		document.form1.btnsubmit.disabled = false;
		return false;
	 }
	document.form1.btnsubmit.disabled = true;
}
/* For comment text area*/
function ismaxlength(obj)
{
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	{
		alert('Sorry you can not enter more than '+mlength+' character.')
		obj.value=obj.value.substring(0,mlength)
	}
}


//added on 12-10-09  for blocked user alert message
function blocked_user_alert(user_type)
{ //alert('hi');
	alert('Your activity has been restricted by this '+user_type+'.' );
	return false;
}

function you_blocked_user()
{ 
	alert('You have blocked this user.');
	return false;
}
function your_activity_blocked()
{ 
	alert('Your activity has been restricted.');
	return false;
}


//For reply to mail
function valid_reply_mail()
		{
			if(document.form1.textarea.value=="")
			{
				alert('Please Enter message.');
				document.form1.textarea.focus();
				return false;
			}
			else if(trim(document.form1.textarea.value)=="")
			 {
				alert('Please Enter message.');
				document.form1.textarea.focus();
				return false;
			 }
			else
				return true;
		}

function ChkValid() //Site pages validation Admin side by Megha on 03-Feb-2010
	{	
		var oEditor = FCKeditorAPI.GetInstance('textdesc') ;
		var v1 = oEditor.GetXHTML( true );

		var obj = document.reg;
		
		if(obj.page_name.value== "")
		{
			alert("Please enter Page name.");
			obj.page_name.focus();
			return false;
		}
		if(oEditor.GetXHTML( true )=="")
		{
			alert("Please enter Content.");
			return false;
		}
		return true;
	}
//Function By Megha on 01-June-2010 
	function validUserName(title) {

	var valid="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ ";
	for (var i=0; i<title.length; i++) {
		if (valid.indexOf(title.charAt(i)) < 0) {
			return false;
		}
	}
	return true;
}
var width = 0;
var height = 0;
var imgAr1 = new Array();
var rImg1 = new Array();
var slide;
function autoplay(slideform) 
{	
	if(document.getElementById("slideshowval").value!="")
	{
		document.getElementById("slideshowval").value="";
		slideform.slidebutton.value="   >   ";
	}
	else
	{
		document.getElementById("slideshowval").value="slideshow";
		slideform.slidebutton.value="   ||   ";
	}
	imgAr1=setimg(slideform);
	setting(imgAr1);
}
function  setimg(slideform)
{
	if(slideform.slide.length>0)
	{	
		for(i=0;i<slideform.slide.length;i++)
		{
		if(slideform.slide[i] != null)
			{				
				imgAr1[i]=slideform.slide[i].value;
			}
		}	
	}
	return  imgAr1;
}
function setting(imgAr1)
{
    slide = document.getElementById('show');
    slide.setAttribute("src", imgAr1[0] );
   // slide.setAttribute("width",width);
   // slide.setAttribute("height",height);
	setTimeout("", 2000);
    slideshow();
}

//Image or picture slide show using java script
//slideshow function
var picture = 0;
function slideshow(){
    if(picture < imgAr1.length-1){
        picture=picture+1;
        slide.setAttribute("src", imgAr1[picture]);
		if(document.getElementById("slideshowval").value!="")
		{
        setTimeout("slideshow()", 2000);
		slide.selectedIndex = picture;
		}
	
    }
    else
        {
			if(document.getElementById("slideshowval").value!="")
			{
			picture = -1;
			slide.selectedIndex = picture;
            setTimeout("slideshow()", 0);
			}
        }
    }
/*----------------------------
*Added by Megha on 30-June-2010
* To Open Demo presentation link
---------------------------*/
function openDemo(url)
{

		MM_openBrWindow_demo(url+'demo/popup.html');
	
}
function MM_openBrWindow_demo(theURL,winName,features) { //v2.0
	var centerWidth = (window.screen.width - 850) / 2;
	var centerHeight = (window.screen.height - 650) / 2;
  features='toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=550,height=425,left='+centerWidth+',top='+centerHeight;
  window.open(theURL,winName,features);
}
/*------------------------------*/


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500');");
}
