
function emailThisPage(rUrl) {
    var target = document.location;

  	var win = window.open(''+rUrl+'/email_with_us.htm?sendurl=' + target, 'notice', 'width=600,height=560,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes');
  	win.focus();
}

function addToFavorite(){
	
	var titleVar = document.title;
	
	var urlVar = document.location;
	
	// firefox
	if (window.sidebar) {
		
		window.sidebar.addPanel(titleVar, urlVar, "");
	}
	// opera
	else if(window.opera && window.print) { 
		var elem = document.createElement('a');
		elem.setAttribute('href',urlVar);
		elem.setAttribute('title',titleVar);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	// ie
	else  {
		window.external.AddFavorite(urlVar,titleVar)
	}	

}


function firefoxAlert(pageurl) {
	
	if(navigator.appName=="Microsoft Internet Explorer") {
		
		pageurl.style.behavior='url(#default#homepage)';pageurl.setHomePage('http://www.exportersindia.com');
	}
	else {
		alert('To set ExportersIndia.com as your home page in Firefox, click and drag the button to the "Home" icon in your browser.');
	}
	return false;
}

function offsetLimit(chk1) {
    if ((Math.floor(chk1.pageno.value)>Math.floor(chk1.maxpage.value) || Math.floor(chk1.pageno.value)<1)  || isNaN(chk1.pageno.value)) {
	    alert("Your Page No should be 1 to  "+chk1.maxpage.value);
	    chk1.pageno.focus()
	    return false;
	}
}

function openWindow(src) {
	
	window.open(src,"mywindow","menubar=0,resizable=1,width=500,height=400")
}

function addCountry(addCont, remCont, countriesHidden, submitVal) {
	var selValue;
	var selValueText;
	var countries='';

	addContEval=eval('document.formn.'+addCont);
	remContEval=eval('document.formn.'+remCont);
	countriesHiddenEval=eval('document.formn.'+countriesHidden);
	for(i=0; i<addContEval.options.length; i++) { 
		if (addContEval.options[i].selected){
			selValue= addContEval.options[i].value;
			if(selValue==''){
				alert('Select Valid Option to Shift');
			}
			else{
				selValueText= addContEval.options[i].text;
				defaultSelectedValue = addContEval.options[i].defaultSelected;
				SelectedValue = addContEval.options[i].selected;
				for(j=0; j<remContEval.options.length; j++) { 
					if(selValue==remContEval.options[j].value){
						alert(''+selValueText+' already exists');
						return false;  
					}
				}
				remContEval.options[remContEval.options.length] = new Option(selValueText, selValue, 0, 0);
			}
		}
	}
	for(j=1; j<remContEval.options.length; j++) { 
		remContEval.options[j]= new Option(remContEval.options[j].text, remContEval.options[j].value, defaultSelectedValue, SelectedValue);
		countries +='^'+remContEval.options[j].value+'';
	}
	countries = countries.substring(1,countries.length);
	var selected_countries = new Array(countries);
	countriesHiddenEval.value = selected_countries.join('^');
	if(submitVal=='Y'){
		document.formn.submit();
	}
}

function remCountry(addCont, remCont, countriesHidden, submitVal) {
	
	var count = 0;
	var countries='';
	var selectedArrayValue = new Array();
	var selectedArrayText = new Array();
	addContEval=eval('document.formn.'+addCont);
	remContEval=eval('document.formn.'+remCont);
	countriesHiddenEval=eval('document.formn.'+countriesHidden);
	if(remContEval.options.length>1){
		for(i=1; i<remContEval.options.length; i++) { 
			if (remContEval.options[i].selected){
			}
			else{
				//alert(i+', '+remContEval.options[i].text);
				selectedArrayValue[count] = remContEval.options[i].value;
				selectedArrayText[count] = remContEval.options[i].text;
				count++;			
				//remContEval.options[i] = null;
			}
		}
		remContEval.length = 1;
	
		for(i=0; i<selectedArrayValue.length; i++) { 
			remContEval.options[remContEval.options.length] = new Option(selectedArrayText[i], selectedArrayValue[i], 0 ,0);
		}
		if (remContEval.options.length == 0) {
			remContEval.options[0] = new Option("   Selections List Here", "", 0 ,0);
		}
	
		for(j=1; j<remContEval.options.length; j++) { 
			var defaultSelectedValue = remContEval.options[i].defaultSelected;
			var SelectedValue = remContEval.options[i].selected;		
			remContEval.options[j]= new Option(remContEval.options[j].text, remContEval.options[j].value, defaultSelectedValue, SelectedValue);
			countries +='^'+remContEval.options[j].value+'';
		}
		countries = countries.substring(1,countries.length);
		var selected_countries = new Array(countries);
		countriesHiddenEval.value = selected_countries.join('^');
		if(submitVal=='Y'){
			document.formn.submit();
		}
	}
	
}

function display_show_format_options(objName,x,newText) {//v4.01
	if ((obj=MM_findObj(objName))!=null) with (obj)
	if (document.layers) {
		document.write(unescape(newText)); document.close();
	}
	else innerHTML = unescape(newText);
}

//function show_format_options(DivId1,flag,DivId2,flag2) {
function show_format_options(DivId1,flag) {
	if(flag=="Y") {
		var Table="<table width=100% cellspacing=0 cellspadding=0 border=0><tr><td width=132>Choose Format :</td><td><select name=disp_final_page class=input><option value=Y>Default</option><option value=N>New</option><option value=\"no_descrip\">With No Description</option></select></td></tr></table>";
	}
	else {
		var Table="<input type=hidden name=hid1>";
	}
	
	display_show_format_options(DivId1,'',Table);
	//display_show_format_options(DivId2,'',TableStruct);
}

function emailHideValidation(formn, actionType) { 
	//alert(actionType);
	var pp=1;	
    var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    len=eval('document.'+formn+'.elements.length');
    formname=eval('document.'+formn);
    var i=0;
    for(i=0; i<len; i++) {
      if ((formname.elements[i].type == "checkbox") && (formname.elements[i].checked == true)) {	
	    var pp=2; 
		var member_id=formname.elements[i].name.substr(11,15);	      
		email_field=eval('document.form1.member_emailids_'+member_id);
 		if(email_field.value.length<1 && actionType=='Hide'){
 			alert("You cannot leave the email field empty");
 			email_field.focus();
 			return false;
 		}
 		else if(!regex.test(email_field.value) && actionType=='Hide'){
 			alert("Invalid email address format");
 			email_field.focus();
 			return false;
 		}
      }
      else if ((formname.elements[i].type == "text") && formname.elements[i].name.substr(0,19)=='tradelead_transfer_' && formname.elements[i].value.length>1 && !regex.test(formname.elements[i].value))  {	
 			alert("Invalid email address format");
 			formname.elements[i].focus();
 			return false;
      }
    }
    if(pp==1){
		alert("Please select any checkbox");
		return false;	      
    }
}
function validCheckbox2(dml) {
	var pp=1;
	var formn=eval('document.'+dml);
	len=formn.elements.length;
	var i=0;
	for(i=0; i<len; i++) {
    	if (formn.elements[i].type == "checkbox" && formn.elements[i].checked==true) {
           	pp=2;
		} 
	}
    if (pp==1) {
    	alert("You have not selected the checkbox");
		return false;
	}
}

function validation_empty() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "file") && (dml.elements[i].value.length>0) && document.form1.imageType.value.length>0) {
         pp=2;
      }
    }
    if (pp==1) {
      alert("Please inserted any File and Select above image type option.");
      return false;
    }
}

function lowerCase(formn,fieldname) {
	var frmObj = eval('document.'+formn+'.'+fieldname);		

	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	var string;
	//var searchVars=new Array("In","Suchas","Such","As","Like","If","This","For","Is","Am","Are","That","Fine");	
	//var ReplaceVars=new Array("in","suchas","such","as","like","if","this","for","is","am","are","that","fine");	
	
	tmpStr = frmObj.value.toLowerCase();
	strLen = tmpStr.length;
	if (strLen > 0)  {
		for (index = 0; index < strLen; index++)  {
			if (index == 0)  {
				tmpChar = tmpStr.substring(0,1).toUpperCase();
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			}
			else {
				tmpChar = tmpStr.substring(index, index+1);
				if ((tmpChar == " " || tmpChar == ",") && index < (strLen-1))  {
					tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
		         }
		     }
		}
	}
	
	/*for (index = 0; index < searchVars.length; index++)  {
		string=tmpStr.replace(/ +searchVars[index]+ /gi, +' '+ReplaceVars[index]+' ');
		alert(string);
		tmpStr=string;
	}*/
	
	results=tmpStr.replace(/ In /gi,' in ');
	results=results.replace(/ Am /gi,' am ');
	results=results.replace(/ Are /gi,' are ');
	results=results.replace(/ Is /gi,' is ');
	results=results.replace(/ This /gi,' this ');
	results=results.replace(/ That /gi,' that ');
	results=results.replace(/ Like /gi,' like ');
	results=results.replace(/ Suchas /gi,' suchas ');
	results=results.replace(/ Such /gi,' such ');
	results=results.replace(/ As /gi,' as ');
	results=results.replace(/ From /gi,' from ');
	results=results.replace(/ Fine /gi,' fine ');
	results=results.replace(/ If /gi,' if ');
	results=results.replace(/ For /gi,' for ');
	results=results.replace(/ And /gi,' and ');
	results=results.replace(/ Have /gi,' have ');
	results=results.replace(/ With /gi,' with ');
	results=results.replace(/ The /gi,' the ');
	results=results.replace(/ A /gi,' a ');
	results=results.replace(/ To /gi,' to ');
	results=results.replace(/ Of /gi,' of ');
	results=results.replace(/ Upto /gi,' upto ');
	results=results.replace(/ Also /gi,' also ');
	results=results.replace(/ Other /gi,' other ');
	results=results.replace(/ Or /gi,' or ');
	results=results.replace(/ Per /gi,' per ');
	results=results.replace(/ All /gi,' all ');
	results=results.replace(/ Amongst /gi,' amongst ');	
	results=results.replace(/ Among /gi,' among ');			
	results=results.replace(/ Also /gi,' also ');				
	
	frmObj.value=results;
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_setTextOfLayer(objName,Type,filename,attrb,alink) { //v4.01

if(Type=="Flash") {
	var bannerText="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' "+attrb+" align='middle' classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>  <PARAM NAME='movie' VALUE='"+filename+"?link="+alink+"'>              <PARAM NAME='quality' VALUE='high'> <PARAM NAME='wmode' VALUE='transparent'> <embed src='"+filename+"?link="+alink+"' quality='high'  "+attrb+" align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent' /></OBJECT>";
}
else {
	bannerText="<a href='"+alink+"' target='_blank'><img src="+filename+" "+attrb+" border=0></a>"
}
if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(bannerText)); document.close();}
    else innerHTML = unescape(bannerText);
}

function mail_sent_valid(dml) {
	if (chktrim(dml.emailID.value).length == 0) {
	    alert("E-mail address can't be left blank");
	    dml.emailID.focus();
		return false;
	}
	if (dml.emailID.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
	    dml.emailID.focus();
	    return false;
	}
	if (dml.emailID.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
	    dml.emailID.focus();
		return false;
	}
}

function	bizvalid(chk) {
	if (chktrim(chk.comment_title.value).length == 0) {
		alert("Title  can't be left blank");
    	chk.comment_title.focus();
    	return false;
   	}
	if (chktrim(chk.comment_detail.value).length == 0) {
		alert("Description can't be left blank");
    	chk.comment_detail.focus();
    	return false;
   	}
	
}

function validform(chk) {
	if (chktrim(chk.imp_keyword.value).length==0) {
		alert("Please Enter the important keyword");
    	chk.imp_keyword.focus();
    	return false;
   	}
	if (chktrim(chk.imp_keyword.value).length<50) {
		alert("Important keyword should be of atleast 50 Characters");
    	chk.imp_keyword.focus();
    	return false;
   	}
}

function validCheckbox1(dml) {
	var pp=1;
	len=dml.elements.length;
	var i=0;
	for(i=0; i<len; i++) {
    	if (dml.elements[i].type == "checkbox" && dml.elements[i].checked==true) {
           	pp=2;
		} 
	}
    if (pp==1) {
    	alert("You have not selected the checkbox");
		return false;
	}  
}

function vanity_search(chk1) {

   if (chktrim(chk1.srch_kword.value)=="" || chk1.srch_kword.value=="Enter Keywords Here . . .") {
      alert("Enter Product / Services Keyword(s)");
      chk1.srch_kword.focus();
	  return false;
  }
}

function home_search(chk1) {
   if (chk1.busty.options[chk1.busty.selectedIndex].value == "0") {
      alert("Select a Business Category");
      chk1.busty.focus();
	  return false;
   }
   if (chktrim(chk1.term.value).length <=1 || (chktrim(chk1.term.value).length >=1 && chk1.term.value=="Enter Keywords here . . .")) {
      alert("Enter Product / Services Keyword(s)");
      chk1.term.focus();
	  return false;
   }
}

function catg_search(chk1) {
	
   	if ( chktrim(chk1.term.value).length <=1 || ( chktrim(chk1.term.value).length >=1 && chk1.term.value=="Enter Keywords here . . .")) {
		alert("Enter Product / Services Keyword(s)");
      	chk1.term.focus();
	  	return false;
   	}
   	if (chk1.srch_catg_ty.options[chk1.srch_catg_ty.selectedIndex].value == "") {
      	alert("Select a Searching Category");
      	chk1.srch_catg_ty.focus();
	  	return false;
   	}   
   	if (chk1.srch_catg_ty.options[chk1.srch_catg_ty.selectedIndex].value == "BC") {
      	alert("Please Select Type Of Bussiness Classified");
      	chk1.srch_catg_ty.focus();
	  	return false;
   	}   
}

function feedback_valid(chk1) {
	
	var pp=1;
    
    feedback_type=document.form1;
    
    len=feedback_type.elements.length;
    
    var i=0;
    
    for(i=0; i<len; i++) {
	    
      if ((document.form1.elements[i].type == "radio") && (feedback_type.elements[i].checked==true)) {
	      
         pp=2;
      }
    }
    
    if (pp==1) {
	    
      alert("You have not selected any Feedback Type.");
      
      return false;
    }	
	
	if (chk1.feedback.value.length<5) {
		
		alert("Enter your Feedback / Suggestions");
		
	    chk1.feedback.focus();
	    
		return false; 
	}	
}

function getCheck_window(username, chk, base_path){
	if (chk.username.value.length == 0) {
		alert("E-mail address can't be left blank");
      	chk.username.focus();
      	return false;
   	}
   	if (chk.username.value.indexOf('@') == -1) {
      	alert("Error in e-mail address");
      	chk.username.focus();
      	return false;
   	}
   	if (chk.username.value.indexOf('.') == -1) {
      	alert("Error in e-mail address");
      	chk.username.focus();
      	return false;
   	}
   	if (chk.username.value.indexOf('@') != chk.username.value.lastIndexOf('@')) {
      	alert("Please Specify One E-mail address only");
      	chk.username.focus();
      	return false;
   	}
   	//To check 'india mart,alibaba etc. words
	if(isProhibited(chk.username)) {
   		return false;
	}
	
	window.open(''+base_path+'join-now.php?id=check_emailid&username='+username+'', 'authcode', 'toolbar=no,directories=no,scrollbars=0,resizable=0,status=no,menubar=0,width=400,height=250');
}


function getCheck_window_new(username, chk, varnm, base_url) {

	fldnm = eval(chk+'.'+varnm);
	if (fldnm.value.length == 0) {
      alert("E-mail address can't be left blank");
      fldnm.focus();
      return false;
   }
   if (fldnm.value.indexOf('@') == -1) {
      alert("Error in e-mail address");
      fldnm.focus();
      return false;
   }
   if (fldnm.value.indexOf('.') == -1) {
      alert("Error in e-mail address");
      fldnm.focus();
      return false;
   }
   if (fldnm.value.indexOf('@') != fldnm.value.lastIndexOf('@')) {
      alert("Please Specify One E-mail address only");
      fldnm.focus();
      return false;
   }
   //To check 'india mart,alibaba etc. words
	if(isProhibited(fldnm)) {
   		return false;
	}
	window.open(base_url+'join-now.php?id=check_emailid&username='+username, "authcode",'toolbar=no,directories=no,scrollbars=0,resizable=0,status=no,menubar=0,width=400,height=250');
}


function getCheck_window1(member_kword,member_id,chk){
	if (chk.member_kword.value.length!= 0) {
		window.open('paid-keyword.php?id=status&member_id='+member_id+'&member_kword='+member_kword+'', 'authcode','toolbar=no,directories=no,scrollbars=0,resizable=0,status=no,menubar=0,width=500,height=300');
	}
}
function getCheck_window2(member_kword1,member_id,chk){
	if (chk.member_kword1.value.length!= 0) {
		window.open('paid-keyword.php?id=status&member_id='+member_id+'&member_kword1='+member_kword1, "authcode",'toolbar=no,directories=no,scrollbars=0,resizable=0,status=no,menubar=0,width=500,height=300');
	}
}	

function chktrim(inputString) {
	if (typeof inputString != "string") { 
		return inputString; 
	}
    var retValue = inputString;
    var ch = retValue.substring(0, 1);
    while (ch == " ") { 
    	retValue = retValue.substring(1, retValue.length);
        ch = retValue.substring(0, 1);
    } 
    ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") { 
    	retValue = retValue.substring(0, retValue.length-1);
        ch = retValue.substring(retValue.length-1, retValue.length);
	}
    while (retValue.indexOf("  ") != -1) { 
    	retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	}
    return retValue; 
} 

function chk_login(chk2) { //this function is for when member searches the party and he not logged in or a guest member.somesh
   if (chk2.user_name.value.length == 0) {
      alert("E-mail ID can't be left blank");
      chk2.user_name.focus();
      return false;
   }
   if (chk2.user_name.value.indexOf('@') == -1) {
      alert("Error in Email ID");
      chk2.user_name.focus();
      return false;
   }
   if (chk2.user_name.value.indexOf('.') == -1) {
      alert("Error in Email ID");
      chk2.user_name.focus();
      return false;
   }
   if (chk2.user_name.value.indexOf('@') !=  chk2.user_name.value.lastIndexOf('@')) {
      alert("Please Specify One Email ID only");
      chk2.user_name.focus();
      return false;
   }  
   //To check 'india mart,alibaba etc. words
	if(isProhibited(chk2.user_name)) {
   		return false;
	}
   if (chk2.pass_word.value.length==0) {
      alert("Enter Your Password ");
      chk2.pass_word.focus();
      return false; 
   }
   
}

//this function is for when member post requirement in post-requirement.php.somesh
function chk_login_post_requirement(chk2) {
	
	if (chk2.req_detail.value.length==0) {
     	alert("Enter Your Requirement Details (Maximum 1000 characters)");
     	chk2.req_detail.focus();
     	return false;
  	}
 	
  	if (chk2.captcha.value.length==0) {
    	alert("Please Enter Confirmation Code");
        joinForm.captcha.focus();
        return false;
	} 	
  	
	if (chk2.user_name.value.length == 0) {
	  alert("E-mail ID can't be left blank");
	  chk2.user_name.focus();
	  return false;
	}
	if (chk2.user_name.value.indexOf('@') == -1) {
	  alert("Error in Email ID");
	  chk2.user_name.focus();
	  return false;
	}
	if (chk2.user_name.value.indexOf('.') == -1) {
	  alert("Error in Email ID");
	  chk2.user_name.focus();
	  return false;
	}
	if (chk2.user_name.value.indexOf('@') !=  chk2.user_name.value.lastIndexOf('@')) {
	  alert("Please Specify One Email ID only");
	  chk2.user_name.focus();
	  return false;
	}  
	
	//To check 'india mart,alibaba etc. words
	if(isProhibited(chk2.user_name)) {
		return false;
	}
	
	if (chk2.pass_word.value.length==0) {
	  alert("Enter Your Password ");
	  chk2.pass_word.focus();
	  return false; 
	}
		
	document.joinForm.id3.value="login";
	document.joinForm.submit();
}

function tradelead_chk(chk1) {
	if (chk1.term.value.length <=1 ) {
		alert("Enter Product Keyword");
		chk1.term.focus();
	    return false;
	}
}
function search_valid(chk2) {
   if (chk2.busty.options[document.search.busty.selectedIndex].value == "0") {
      alert("Select a Business Category");
      chk2.busty.focus();
	  return false;
   }
   if (chktrim(chk2.term.value).length <=1 && chk2.term.value!="Enter Keywords here . . .") {
      alert("Enter Product Keyword");
      chk2.term.focus();
	  return false;
   }
}

function openwin(file,Iwidth,Iheight) {
   var newWin1=window.open(file,'nWin1','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width=400,height=300,screenX=0,screenY=0,left=20,top=20');
}
function openwin1(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin2','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}
function openwin2(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin3','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width=560,height=500,screenX=0,screenY=0,left=20,top=20');
}
function openwin3(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin5','x=0,y=0,toolbar=no, menubar=yes, location=no, directories=no,status=yes,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}
function openwin4(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin4','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}
function openwin5(nm,keyword,bus_type,product_category) {
	var pop = '';
	var name=nm;
    if (pop && !pop.closed) {
         pop.close();
    }
    var key1  = ",";
    var newStr = keyword.replace(/ /gi, key1)
    pop=eval("window.open('"+name+"&keyword="+newStr+"&bus_type="+bus_type+"&product_category="+product_category+"','NewWIN','chrome[4],toolbar=no,left=10,top=5,width=600,height=450,directories=no,menubar=no,SCROLLBARS=yes')");
    if (!pop.opener) popUpWin.opener = self;
}


function newBizValid(id1,chk1) {
	if (chk1=="chk") {
   		len=id1.elements.length;
   		var i=0;
 		var pp=1;
   		for (i=0; i<len; i++) {
	   		 if (id1.elements[i].type == "checkbox" && id1.elements[i].checked==true) {
				pp=2;
			}
		}
  		if (pp==1) {
	  		alert("Please select your Product checkbox");
	  		return false;
  		} 
   	}
   	if (chktrim(id1.your_name.value).length==0) {
      	alert("Enter your name");
	  	id1.your_name.focus();
      	return false;
   	}
   	if (chktrim(id1.comp_name.value).length==0) {
      	alert("Enter your company name");
	  	id1.comp_name.focus();
      	return false;
   	}
   	if (chktrim(id1.address.value).length ==0) {
      	alert("Enter your Postal Address");
      	id1.address.focus();
      	return false;
   	}
   	if (id1.country.options[id1.country.selectedIndex].value=="")  {
      	alert("Select your Country");
      	id1.country.focus();
      	return false;
   	}
   	if (chktrim(id1.username.value).length == 0) {
      	alert("E-mail address can't be left blank");
      	id1.username.focus();
      	return false;
   	}
   	if (id1.username.value.indexOf('@') == -1) {
      	alert("Error in e-mail address");
      	id1.username.focus();
      	return false;
   	}
   	if (id1.username.value.indexOf('.') == -1) {
      	alert("Error in e-mail address");
      	id1.username.focus();
      	return false;
   	}
   if (id1.username.value.indexOf('@') != id1.username.value.lastIndexOf('@')) {
      alert("Please Specify One E-mail address only");
      id1.username.focus();
      return false;
   }
   if (chktrim(id1.your_requirement.value).length==0)  {
      alert("Enter Your Requirement");
      id1.your_requirement.focus();
      return false;
   }		
}

function chk_form1(id1, tlType) {
	
	if (tlType=="exist") {
		
     	len=id1.elements.length;
     	
	 	var i=0;
	 	
 	 	var pp=1;
 	 	
   	 	for (i=0; i<len; i++) {
	   	 	
        	if (id1.elements[i].type == "radio" && id1.elements[i].checked==true && id1.elements[i].name=="tradeleadID") {
           		pp=2;
	    	}
	 	}
     	if (pp==1) {
	    	alert("Select one of the existing Trade Lead");
	    	return false;
    	}
	}
	else {
				
		if (id1.tradelead_type.options[id1.tradelead_type.selectedIndex].value == "x") {
			
	       	alert("Select Trade Lead Type"); 
	        id1.tradelead_type.focus();
	        return false;  
	    }
	    if (id1.subject.value.length == 0) {
		    
	        alert("Do not leave Subject field blank");
	        id1.subject.focus();
	        return false; 
	    }
	    if (id1.subject.value.length>40) {
		    
	        alert("Please Enter Subject Maximum Of 40 Characters");
	        id1.subject.focus();
	        return false; 
	    }
	    if (id1.quantity.value.length==0) {
	        alert("Please Enter Quantity");
	        id1.quantity.focus();
	        return false; 
	    }
	    
	    
	    if (id1.details.value.length>1000) {
	        alert("Your Details limit upto 1000 characters");
	        id1.details.focus();
	        return false; 
	    }
	    if ((!id1.details.value.indexOf('.com')) || (!id1.details.value.indexOf('.net')) || (!id1.details.value.indexOf('.www'))) {
	        alert("Don't specify your site address in Details fields");
	        id1.details.focus();
	        return false;
	    }
	    
	    
	    if (id1.details.value.length <= 1) {
	        alert("Enter Your Trade Lead Details");
	        id1.details.focus();
	        return false; 
	    }
	   	    
	    if(id1.bus_listing_status.value=='N') {
		    
		    if (id1.tradelead_type.options[id1.tradelead_type.selectedIndex].value=="offer" && id1.bus_status.value=='Y') {
		     
			    if (id1.bus_ty.options[id1.bus_ty.selectedIndex].value=="") {
				    
			        alert("Please Select Your Business Type");
			        id1.bus_ty.focus();
			        return false; 
			    }
			    
			    if (id1.product_desc.value.length==0) {
				    
			        alert("Please Enter Your Products/Services Details");
			        id1.product_desc.focus();
			        return false; 
		    	}
		    }
	    }
	}
	
    if (tlType=="exist" || tlType=="tlpd") {
	    
	    if ((!id1.mode_opt[0].checked) && (!id1.mode_opt[1].checked) && (!id1.mode_opt[2].checked) && (!id1.mode_opt[3].checked) && (!id1.mode_opt[4].checked) && (!id1.mode_opt[5].checked)) {
		
		alert("Please check Your Mode Of Payment");
		
		id1.mode_opt[0].focus();
		
		return false;
		}
		
		/* Credit Cards Mode */
		if(id1.mode_opt[0].checked) {
			
			if((!id1.pymt_mode[0].checked) && (!id1.pymt_mode[1].checked) && (!id1.pymt_mode[2].checked)) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[0].focus();
			
				return false;
			}
		}
		
		/* Net Banking Mode */
		if(id1.mode_opt[1].checked) {
			
			if(!id1.pymt_mode[3].checked) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[3].focus();
			
				return false;
			}
		}
		
		/* Deposit A Cheque Mode */
		if(id1.mode_opt[2].checked) {
			
			if((!id1.pymt_mode[4].checked) && (!id1.pymt_mode[5].checked) && (!id1.pymt_mode[6].checked) && (!id1.pymt_mode[7].checked) && (!id1.pymt_mode[8].checked) && (!id1.pymt_mode[9].checked)) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[4].focus();
			
				return false;
			}
		}
		
		/* Paypal Mode */
		if(id1.mode_opt[3].checked) {
			
			if(!id1.pymt_mode[10].checked) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[10].focus();
			
				return false;
			}
		}
		
		/* Mobile Phone Mode */
		if(id1.mode_opt[4].checked) {
			
			if(!id1.pymt_mode[11].checked) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[11].focus();
			
				return false;
			}
			if (id1.pymt_mode[11].checked && chktrim(id1.mobile_phone.value).length ==0) {
			
				alert("Please Enter Your Mobile Number");
				id1.mobile_phone.focus();
				return false;
			}
		}
		
		/*Other Online Payment Option Mode */
		if(id1.mode_opt[5].checked) {
			
			if(!id1.pymt_mode[12].checked) {
				
				alert("Please check Your Payment Options");
			
				id1.pymt_mode[12].focus();
			
				return false;
			}
		}
	    
	    /*
        if ((!id1.pymt_mode[0].checked) && (!id1.pymt_mode[1].checked) && (!id1.pymt_mode[2].checked) && (!id1.pymt_mode[3].checked) && (!id1.pymt_mode[4].checked) && (!id1.pymt_mode[5].checked) && (!id1.pymt_mode[6].checked) && (!id1.pymt_mode[7].checked) && (!id1.pymt_mode[8].checked) && (!id1.pymt_mode[9].checked) && (!id1.pymt_mode[10].checked) && (!id1.pymt_mode[11].checked) && (!id1.pymt_mode[12].checked)) {
   	       alert("Please check Your Mode Of Payment");
           id1.pymt_mode[0].focus();
 	       return false;
	    }*/	    
    }
}


function typedown(obj,defaultval) {
	if(obj.value==defaultval) {
		obj.value=''
	}
}

function deleteNow(cnt1) {
	var pp=1;
	for (var j = 1; j <= cnt1; j++) {
		box = eval('document.form1.chk_' + j);
		if (box.checked == true) {
			pp=2;
		} 
	}
	if (pp==1) {
		alert("You have not selected any Inquiries .\n\nPlease select the Inquiries && then proceed");
		return false;
	}  
	p2 = confirm('Are you sure want to delete');
	if (!p2) {
		return false;
	}
}



function chkMySearch(chk1) {
 	if (chk1.keyword.value.length <2) {
    	alert("Enter Your Keyword");
        chk1.keyword.focus();
        return false; 
	}
    if ((!chk1.search_for[0].checked) && (!chk1.search_for[1].checked) && (!chk1.search_for[2].checked)) {
		alert("Select Search In");
        return false; 
	}
    if ((chk1.search_for[0].checked) && (chk1.iyp_bus_ty.options[chk1.iyp_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Your Business Category for Indian Classified");
        chk1.iyp_bus_ty.focus();
        return false; 
	}
    if ((chk1.search_for[1].checked) && (chk1.fyp_bus_ty.options[chk1.fyp_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Your Business Category for Foreign Classified");
        chk1.fyp_bus_ty.focus();
        return false; 
	}
    if ((chk1.search_for[2].checked) && (chk1.tl_bus_ty.options[chk1.tl_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Trade Lead Type");
        chk1.tl_bus_ty.focus();
        return false; 
	}
    if (chk1.search_type.options[chk1.search_type.selectedIndex].value == "x") {	  
    	alert("Enter Your Keyword");
        chk1.search_type.focus();
        return false; 
	}
}

// Function used for old advanced search.somesh
function advanceSearch(chk1) {
	
 	if (chk1.keyword.value.length <2) {
    	alert("Enter Your Keyword");
        chk1.keyword.focus();
        return false; 
	}
	if (chk1.search_base[0].checked) {
	    if ((!chk1.search_for[0].checked) && (!chk1.search_for[1].checked) && (!chk1.search_for[2].checked)) {
			alert("Select Business Type / Business Category");
			chk1.search_for[0].focus();
	        return false; 
		}
	}
	if (chk1.search_base[1].checked) {
	    if ((!chk1.search_for[0].checked) && (!chk1.search_for[1].checked)) {
			alert("Select Business Type / Business Category");
			chk1.search_for[0].focus();
	        return false; 
		}
	}
    if ((chk1.search_for[0].checked) && (chk1.iyp_bus_ty.options[chk1.iyp_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Your Business Category for Indian Classified");
        chk1.iyp_bus_ty.focus();
        return false; 
	}
    if ((chk1.search_for[1].checked) && (chk1.fyp_bus_ty.options[chk1.fyp_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Your Business Category for Foreign Classified");
        chk1.fyp_bus_ty.focus();
        return false; 
	}
    if ((chk1.search_for[2].checked) && (chk1.tl_bus_ty.options[chk1.tl_bus_ty.selectedIndex].value == "x")) {	  
    	alert("Select Trade Lead Type");
        chk1.tl_bus_ty.focus();
        return false; 
	}
}
// New Function for newly created advanced search.somesh
function advanceSearch_new(chk1) {
	
 	if (chk1.keyword.value.length <2) {
    	alert("Enter Your Keyword");
        chk1.keyword.focus();
        return false; 
	}
	if (chk1.search_base[1].checked) {
	    if ((!chk1.search_for[0].checked) && (!chk1.search_for[1].checked)) {
			alert("Select Business Type / Business Category");
			chk1.search_for[0].focus();
	        return false; 
		}
	
	    if ((chk1.search_for[0].checked) && (chk1.iyp_bus_ty.options[chk1.iyp_bus_ty.selectedIndex].value == "x")) {	  
	    	alert("Select Your Business Category for Indian Classified");
	        chk1.iyp_bus_ty.focus();
	        return false; 
		}
	    if ((chk1.search_for[1].checked) && (chk1.fyp_bus_ty.options[chk1.fyp_bus_ty.selectedIndex].value == "x")) {	  
	    	alert("Select Your Business Category for Foreign Classified");
	        chk1.fyp_bus_ty.focus();
	        return false; 
		}
	}
}
function validCheckbox(dml, msg, delstat) {
	var pp=1;
	len=dml.elements.length;
	var i=0;
	for(i=0; i<len; i++) {
    	if (dml.elements[i].type == "checkbox" && dml.elements[i].checked==true) {
           	pp=2;
		} 
	}
    if (pp==1) {
    	alert("You have not selected the checkbox");
		return false;
	}  
    else if (delstat=="Y")  {
    	return confirm('Are you sure you want to delete')      
	}
}
	
function chk_charlen(var1, var2) {
	box1 = eval('document.' + var1 + '.' + var2)
	box2 = eval('document.' + var1);
	box2.char_len.value=box1.value.length;
}

function chk_joinnow(chk1, pchk) { // validation on join now first page.somesh	
	/*if (pchk=="Y") {
	  	if (!chk1.member_type[0].checked && !chk1.member_type[1].checked && !chk1.member_type[2].checked && !chk1.member_type[3].checked && !chk1.member_type[4].checked) {
	    	alert("Select Membership option");
	        return false;
		}
	}*/
	if (chk1.country.options[chk1.country.selectedIndex].value == "x") {
	  	alert("Select Country Name ");
	    chk1.country.focus();
	    return false;
	}
	if (chktrim(chk1.username.value).length == 0) {
	    alert("E-mail address can't be left blank");
	    chk1.username.focus();
		return false;
	}
	if (chk1.username.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
	    chk1.username.focus();
	    return false;
	}
	if (chk1.username.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
	    chk1.username.focus();
	    return false;
	}
	if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
		alert("Please Specify One E-mail address only");
	    chk1.username.focus();
	    return false;
	}
	//To check 'india mart,alibaba etc. words
	if(isProhibited(chk1.username)) {
   		return false;
	}  
	if (pchk=="Y") {	
		/*if (!chk1.member_type[1].checked	&&  chk1.bus_category.options[chk1.bus_category.selectedIndex].value == "x") {
			alert("Select Company Nature of Business ");
	        chk1.bus_category.focus();
	        return false;
		}*/
		if (chk1.bus_category.options[chk1.bus_category.selectedIndex].value == "x") {
			alert("Select Company Nature of Business ");
	        chk1.bus_category.focus();
	        return false;
		}
	}
}

function chk_joinnow_new(chk1, pchk) { // validation on join now first page.somesh			
	if (chktrim(chk1.username.value).length == 0) {
	    alert("E-mail address can't be left blank");
	    chk1.username.focus();
		return false;
	}
	if (chk1.username.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
	    chk1.username.focus();
	    return false;
	}
	if (chk1.username.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
	    chk1.username.focus();
	    return false;
	}
	if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
		alert("Please Specify One E-mail address only");
	    chk1.username.focus();
	    return false;
	}
	//To check 'india mart,alibaba etc. words
	if(isProhibited(chk1.username)) {
   		return false;
	}
	
	if (chk1.cpassword.value.length <6) {
		alert("New Password must be 6 characters ");
		chk1.cpassword.focus();
	    return false; 
	}
	if (chk1.cpassword.value.length <6) {
		alert("Confirm New Password must be 6 characters ");
		chk1.cpassword.focus();
	    return false; 
	}
	if (chk1.cpassword.value != chk1.confirmpassword.value) { 
		alert("Your new password && confirm new password dosn't match");
	    chk1.confirmpassword.focus();
		return false; 
	}
		
	if (pchk=="Y") {		
		var pp=1;
	    dml=chk1;
	    len=dml.elements.length;	    
	    var i=0;
	    for(i=0; i<len; i++) {
	      if ((chk1.elements[i].type == "checkbox") && (dml.elements[i].checked==true)) {
	         pp=2;
	      }
	    }
	    if (pp==1) {
	      	alert("Please Select Business Type");
	      	return false;
	    }	    
    }     	
	
	if (chk1.country.options[chk1.country.selectedIndex].value == "x") {
	  	alert("Select Country Name ");
	    chk1.country.focus();
	    return false;
	}
}



function validChngPass(chk1) {
	if (chk1.username.value.length == 0) {
		alert("E-mail address can't be left blank");
		chk1.username.focus();
		return false;
	}
	if (chk1.username.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
		chk1.username.focus();
	    return false;
	}
	if (chk1.username.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
		chk1.username.focus();
		return false;
	}
	if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
		alert("Please Specify One E-mail address only");
		chk1.username.focus();
	    return false;
	}  
	if (chk1.npassword.value.length <6) {
		alert("New Password must be 6 characters ");
		chk1.npassword.focus();
	    return false; 
	}
	if (chk1.cpassword.value.length <6) {
		alert("Confirm New Password must be 6 characters ");
		chk1.cpassword.focus();
	    return false; 
	}
	if (chk1.cpassword.value != chk1.npassword.value) { 
		alert("Your new password && confirm new password dosn't match");
	    chk1.npassword.focus();
		return false; 
	}
}

function checkAll(val) {
   	dml=document.form1;
   	len=dml.elements.length;
   	var i=0;
   	for (i=0; i<len; i++) {
     	if (document.form1.elements[i].type == "checkbox") {
        	if (val == 1) {
           		dml.elements[i].checked=true;
        	} 
			else {
           		dml.elements[i].checked=false;
        	}
     	}   
   	}
}

function validChgInfo(dml) {
	if (dml.ph_acode.value.length ==0) {
        alert("Enter Phone Number - Area Code");
        dml.ph_acode.focus();
        return false;
     }
     if (!parseInt(dml.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        dml.ph_acode.focus();
        return false;
     }
     if (chktrim(dml.ph_number.value).length ==0) {
        alert("Enter Phone Number");
        dml.ph_number.focus();
        return false;
     }
	if (chktrim(dml.alternate_email.value).length > 0) {
		if (dml.alternate_email.value.indexOf('@') == -1) {
			alert("Error in e-mail address");
	    	dml.alternate_email.focus();
	    	return false;
		}
		if (dml.alternate_email.value.indexOf('.') == -1) {
			alert("Error in e-mail address");
	    	dml.alternate_email.focus();
			return false;
		}
	}
	if (chktrim(dml.mobile_phone.value).length > 0) {
 	   if (!parseInt(dml.mobile_phone.value)) {
    	   alert("Incorrect Mobile Phone Number");
        	dml.mobile_phone.focus();
        	return false;
     	}
 	   if (chktrim(dml.mobile_phone.value).length < 5) {
    	   alert("Incomplete Mobile Phone Number");
        	dml.mobile_phone.focus();
        	return false;
     	}
	}
	if (chktrim(dml.reliance_phone.value).length > 0) {
 	   if (!parseInt(dml.reliance_phone.value)) {
    	   alert("Incorrect Reliance Phone Number");
        	dml.reliance_phone.focus();
        	return false;
     	}
 	   if (chktrim(dml.reliance_phone.value).length < 5) {
    	   alert("Incomplete Reliance Phone Number");
        	dml.reliance_phone.focus();
        	return false;
     	}
	}
}	

function records_transfer() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "radio") && (dml.elements[i].checked==true)) {
         pp=2;
      }
    }
    if (pp==1) {
      alert("You have not selected any Record.");
      return false;
    }
}

function addto_basket_new() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "checkbox") && (dml.elements[i].checked==true)) {
         pp=2;
      }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.id.value="addtoBasket";
      	document.form1.target="";
      	document.form1.submit();
   }
}

function addto_basket() {
	var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if (dml.elements[i].type == "checkbox" && dml.elements[i].name != "checked_1"  && dml.elements[i].checked==true) {
         pp=2;
      }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties & then proceed");
      	return false;
    }
    else {
      	document.form1.id.value="Add to Basket";
      	document.form1.target="";
      	document.form1.submit();
   }
}

function inquire_now() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
       if (dml.elements[i].type == "checkbox" && dml.elements[i].name != "checked_1" && dml.elements[i].checked==true) {
          pp=2;
       }
    }
    if (pp==1) {
      alert("You have not selected any party.\n\nPlease select the parties && then proceed");
      return false;
    }
    else {
      document.form1.id.value="Send Inquiry Now";
      document.form1.target="";
      document.form1.submit();
    }
}

function vanity_inquire_now() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
       if (dml.elements[i].type == "checkbox" && dml.elements[i].name != "checked_1"  && dml.elements[i].checked==true) {
          pp=2;
       }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.submit();
    }
}

function validSRCHform(dml, srchTy) {
	if (srchTy=="IN" && dml.busty.options[dml.busty.selectedIndex].value == "0") {
		alert("select a business category");
	    dml.busty.focus();
	    return false;
	}
    if (dml.term.value.length <=1 ) {
        alert("Enter Product Keyword(s)");
        dml.term.focus();
        return false;
    }
}


function checkChrLen(formNm, fldNm, fldLen, altDetl) {
	box1 = eval('document.' + formNm+ '.' + fldNm)
	if (box1.value.length>fldLen) {
    	alert(altDetl);
        box1.focus();
        return false;
	}
}

function chk_user_det(chk1,val,from) { //Finction to check validation on member requirement(mem_req.php) page.somesh
	if (from=="tl") {
		if (chk1.tradelead_type.value=="x") {
        	alert("Enter Your Trade Lead Type");
         	chk1.tradelead_type.focus();
         	return false;
      	}
	  	if (chk1.quantity.value=="") {
        	alert("Enter Quantity");
         	chk1.quantity.focus();
         	return false;
      	}
      	if (chk1.subject.value=="") {
        	alert("Enter subject");
         	chk1.subject.focus();
         	return false;
      	}
      	if (chk1.keywords.value=="") {
        	alert("Enter keywords");
         	chk1.keywords.focus();
         	return false;
      	}
      	if (chk1.details.value=="") {
         	alert("Enter details");
         	chk1.details.focus();
         	return false;
      	}
  	}
	if (from=="memb_req") {
		if (chk1.req_title.value.length==0) {
         	alert("Enter Your Requirement Keywords ");
         	chk1.req_title.focus();
         	return false;
      	}
		if (chk1.req_detail.value.length==0) {
         	alert("Enter Your Requirement Details (Maximum 1000 characters)");
         	chk1.req_detail.focus();
         	return false;
      	}
  	}
	if (val=="y") {
		if (chk1.username.value.length == 0) {
        	alert("E-mail address can't be left blank");
    	   	chk1.username.focus();
        	return false;
      	}
    	if (chk1.username.value.indexOf('@') == -1) {
         	alert("Error in e-mail address");
         	chk1.username.focus();
         	return false;
    	}
    	if (chk1.username.value.indexOf('.') == -1) {
			alert("Error in e-mail address");
         	chk1.username.focus();
         	return false;
    	}
     	if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
			alert("Please Specify One E-mail address only");
         	chk1.username.focus();
         	return false;
     	}
      	//To restict indiamart,tradeindia,alibaba etc. email id .somesh
    	if(isProhibited(chk1.username)) {
   			return false;
		}
   		if (chk1.cpassword.value.length<6) {
         	alert("Password should be of 6 characters minimum");
         	chk1.cpassword.focus();
         	return false;
    	}
    	if (chk1.cpassword.value != chk1.confirmpassword.value) {
         	alert("Password && Confirm Password fields differ");
         	chk1.confirmpassword.focus();
         	return false;
      	}
		if (chk1.your_name.value.length==0) {
         	alert("Enter Your Name ");
         	chk1.your_name.focus();
         	return false;
      	}
      	//To check .net .com etc words in Your name field
		if (!isValid(chk1.your_name)) {
    		return false;
 		}
 		if (chk1.comp_name.value.length==0) {
         	alert("Enter Your Company Name ");
         	chk1.comp_name.focus();
         	return false;
      	}
    	//To check .net .com etc words in Company name field
		/*if(!isValid(chk1.comp_name)) {
    		return false;
 		}*/
 		if (chk1.country.options[chk1.country.selectedIndex].value == "x") {
      		alert("Select Country Name ");
      		chk1.country.focus();
      		return false;
     	}
      	if (chk1.street_address.value.length==0) {
        	alert("Enter Your Address ");
         	chk1.street_address.focus();
         	return false;
      	}
      	//To check .net .com etc words in name field
    	if (!isValid(chk1.street_address)) {
    		return false;
 		}
		if (chk1.country.options[chk1.country.selectedIndex].value == "IN" && chk1.postal_code.value.length<6) {
       		alert("Enter Your Postal Code ");
       		chk1.postal_code.focus();
       		return false;
      	}
      	if (chk1.country.options[chk1.country.selectedIndex].value != "IN" && chk1.postal_code.value.length==0) {
       		alert("Enter Your Postal Code ");
       		chk1.postal_code.focus();
       		return false;
  		}
      	if (chk1.ph_ccode.value.length==0) {
			alert("Enter Your Country Code ");
         	chk1.ph_ccode.focus();
			return false;
      	}
      	if (chk1.ph_acode.value.length==0) {
			alert("Enter Your Area Code ");
         	chk1.ph_acode.focus();
         	return false;
      	}
      if (chk1.ph_number.value.length==0) {
         alert("Enter Your Phone Number ");
         chk1.ph_number.focus();
         return false;
      }
  }
  else {
	  chk1.submit();
  }
}


//Function to check validation on member requirement(post-requirement.php) page and for post trade lead(post-trade-lead.php) page.somesh
function post_requirement_det(chk1,val,from) { 
	
	if (from=="tl") {
	
		if (chk1.tradelead_type.value=="x") {
			
        	alert("Enter Your Trade Lead Type");
         	chk1.tradelead_type.focus();
         	return false;
      	}
      	if (chk1.subject.value=="") {
	      	
        	alert("Enter subject");
         	chk1.subject.focus();
         	return false;
      	}
      	if (chk1.subject.value.length>40) {
	      	
         	alert("Please Enter Subject Maximum Of 40 Characters");
         	chk1.subject.focus();
         	return false;
      	}
	  	if (chk1.quantity.value=="") {
        	alert("Enter Quantity");
         	chk1.quantity.focus();
         	return false;
      	}
      	if (chk1.details.value=="") {
         	alert("Enter details");
         	chk1.details.focus();
         	return false;
      	}
    }
  	
	if (from=="post_requirement") {
		
		if (chk1.req_detail.value.length==0) {
         	alert("Enter Your Requirement Details (Maximum 1000 characters)");
         	chk1.req_detail.focus();
         	return false;
      	}
  	}
  	
 
  	if (chk1.captcha.value.length==0) {
	  	
    	alert("Please Enter Confirmation Code");
    	
        chk1.captcha.focus();
        
        return false;
	}
  	
	if (val=="y") {
		
   		if (chk1.your_name.value.length==0) {
         	alert("Enter Your Name ");
         	chk1.your_name.focus();
         	return false;
      	}
      	//To check .net .com etc words in Your name field
		if (!isValid(chk1.your_name)) {
    		return false;
 		}
 		
 		//To restict indiamart,tradeindia,alibaba etc. email id .somesh
    	if(isProhibited(chk1.username)) {
	    	return false;
    	}
    	
    	//To check .net .com etc words in Company name field
    	if(!isValid(chk1.comp_name)) {
    		return false;
 		}
 		
 		if (chk1.comp_name.value.length==0) {
         	alert("Enter Your Company Name ");
         	chk1.comp_name.focus();
         	return false;
      	}
      	
      	if (chk1.username.value.length == 0) {
	 		alert("Enter E-mail Address");
			chk1.username.focus();
			return false;
      	}
    	if (chk1.username.value.indexOf('@') == -1) {
         	alert("Error in e-mail address");
         	chk1.username.focus();
         	return false;
    	}
    	if (chk1.username.value.indexOf('.') == -1) {
			alert("Error in e-mail address");
         	chk1.username.focus();
         	return false;
    	}
     	if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
			alert("Please Specify One E-mail address only");
         	chk1.username.focus();
         	return false;
     	}      	
     	
     	if (chktrim(chk1.password1.value.length)==0) {
	     	
        	alert("Enter Your Password ");
         	chk1.password1.focus();
         	return false;
      	}      	
     	
     	if (chk1.street_address.value.length==0) {
        	alert("Enter Your Address ");
         	chk1.street_address.focus();
         	return false;
      	}
      	//To check .net .com etc words in name field
    	if (!isValid(chk1.street_address)) {
    		return false;
 		}
 		 		
 		if (chk1.country.options[chk1.country.selectedIndex].value == "x") {
      		alert("Select Country Name ");
      		chk1.country.focus();
      		return false;
     	}
     	 
     	if (from=="post_requirement") {
	     	
	     	if (chk1.country.options[chk1.country.selectedIndex].value == "IN" && chk1.state.options[chk1.state.selectedIndex].value == "" ) {
		     	
	      		alert("Select State Name ");	      		
	      		chk1.state.focus();	      		
	      		return false;
	     	}    	
     	}
     	 		
 		if (chk1.ph_ccode.value.length==0) {
			alert("Enter Your Country Code ");
         	chk1.ph_ccode.focus();
			return false;
      	}
      	
      	if (chk1.ph_acode.value.length==0) {
			alert("Enter Your Area Code ");
         	chk1.ph_acode.focus();
         	return false;
      	}
      	
        if (chk1.ph_number.value.length==0 && chk1.mobile_phone.value.length==0) {
	        
        	alert("Enter Your Landline(s) / Mobiles(s) Number ");
         	chk1.ph_number.focus();
         	return false;
        }      	
        
        if (chk1.tradelead_type.value=="Demand") {
	        
		    if (chk1.bus_ty1.options[chk1.bus_ty1.selectedIndex].value=="") {
			    
		        alert("Please Select Your Business Type");
		        chk1.bus_ty1.focus();
		        return false; 
		    }
	    }
	    
	    if (chk1.tradelead_type.value=="Offer") {
		    
		    if (chk1.bus_ty2.options[chk1.bus_ty2.selectedIndex].value=="") {
			    
		        alert("Please Select Your Business Type");
		        chk1.bus_ty2.focus();
		        return false; 
		    }
		    if (chk1.product_desc1.value.length==0) {
			    
		        alert("Please Enter Your Products/Services Details");
		        chk1.product_desc1.focus();
		        return false; 
	    	}
    	}

	    
	    /*
        if (document.joinForm.bus_ty.options[document.joinForm.bus_ty.selectedIndex].value=="")  {
	   		alert("select Nature of Business Type");
	   		document.joinForm.bus_ty.focus();
	   		return false;
	   	}
	   	if (document.joinForm.bus_ty.options[document.joinForm.bus_ty.selectedIndex].value!="x" && document.joinForm.comp_name.value.length==0) {	   		
			alert("Enter Company Name");	
	   		document.joinForm.comp_name.focus();
	 		return false;		   		
   		}	   		
   		if (document.joinForm.bus_ty.options[document.joinForm.bus_ty.selectedIndex].value!="x") {
   			if (document.joinForm.product_desc.value.length<10) {
	   			alert("Enter Products/Services Detail ");		   			
   				document.joinForm.product_desc.focus();
	   			return false;	 			
   			}
   			else if (document.joinForm.product_desc.value.length>350) {
	   			alert("Enter Products/Services Detail not exceed 350 characters");	
   				document.joinForm.product_desc.focus();
	   			return false;		   			
   			}
		}*/
		
		if (!joinForm.iagree.checked) {
			alert("You must check the Terms && Conditions");
        	joinForm.iagree.focus();
        	return false;
		}
		
		if (from=="post_requirement") {	 
			
			document.joinForm.id4.value="submit_member";
			document.joinForm.submit();
		}
   	}
   	
	if (val=="n") {
		
		if (chk1.user_name.value.length == 0) {
		  alert("E-mail ID can't be left blank");
		  chk1.user_name.focus();
		  return false;
		}
		if (chk1.user_name.value.indexOf('@') == -1) {
		  alert("Error in Email ID");
		  chk1.user_name.focus();
		  return false;
		}
		if (chk1.user_name.value.indexOf('.') == -1) {
		  alert("Error in Email ID");
		  chk1.user_name.focus();
		  return false;
		}
		if (chk1.user_name.value.indexOf('@') !=  chk1.user_name.value.lastIndexOf('@')) {
		  alert("Please Specify One Email ID only");
		  chk1.user_name.focus();
		  return false;
		}  
		//To check 'india mart,alibaba etc. words
		if(isProhibited(chk1.user_name)) {
		   return false;
		}
		if (chk1.pass_word.value.length==0) {
		  alert("Enter Your Password ");
		  chk1.pass_word.focus();
		  return false; 
		}
	}
}

function chk12() {
	document.joinForm.char_len.value=document.joinForm.req_detail.value.length;
    if (document.joinForm.req_detail.value.length>1000) {
    	alert("Your Description exceeds 1000 characters");
        document.joinForm.req_detail.focus();
        return false;
	}
}


function chk_joinnow1_new(chk1, check_login, id, member_type, id1 ) { // validation on join now second page(first half).somesh

	var i;
	
	var pp=2;

	for(i=1; i<=chk1.total_bus_type.value; i++) {
		
		var fld_name = 'product_desc_'+i;	
		
		//alert(i);	

		alert(document.chk1.fld_name.value);
		//alert (chk1.fld_name.value);
		/*if(chk1.fld_name.value.length>10) {
			pp=1;
		}*/		
	}
	if(pp==2) {
		alert("hiiiiiiiii");
	}

    /*if (check_login!="true") {
    	if (id!="paid_member" && id!="hp" && id!="new_catg") {
			if (chktrim(chk1.cpassword.value).length <6) {
		        alert("Password must be 6 characters ");
		        chk1.cpassword.focus();
		        return false;
			}
		    if (chktrim(chk1.confirmpassword.value).length <6) {
		        alert("Re-enter Password must be 6 characters ");
		        chk1.confirmpassword.focus();
		        return false;
		    }
		    if ((chk1.cpassword.value) != (chk1.confirmpassword.value)) {
		        alert("Your Password & Re-enter password dosn't match");
		        chk1.cpassword.focus();
		        return false;
		    }
		}
	}
    if (chktrim(chk1.your_name.value).length==0) {
        alert("Enter your name");
        chk1.your_name.focus();
        return false;
    }
    
    //To check .net .com etc words in name field
    if(!isValid(chk1.your_name)) {
    	return false;
 	}
	
	if (member_type!="0" && id1!="tlpd" && id1!="bo" && id1!="em") {
        if (chktrim(chk1.comp_name.value).length==0) {
            alert("Enter your company name");
            chk1.comp_name.focus();
            return false;
        }  
        if (chktrim(chk1.designation.value).length==0) {
            alert("Enter Your Designation at work ");
            chk1.designation.focus();
            return false;
        }
        //To check .net .com etc words in designation field
      	 if((chktrim(chk1.designation.value).length!=0)&&(!isValid(chk1.designation))) {
			return false;
 		}
    }
     if (chktrim(chk1.street_address.value).length ==0) {
        alert("Enter your Street Address");
        chk1.street_address.focus();
        return false;
     }
    //To check .net .com etc words in address field
    if(!isValid(chk1.street_address)) {
    	return false;
 	}
     if ((chk1.country.value == "IN") &&  (chk1.state.options[chk1.state.selectedIndex].value == "x")) {
        alert("Select your State");
        chk1.state.focus();
        return false;
     }
     if (chktrim(chk1.postal_code.value).length == 0) {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }     
     if (chktrim(chk1.postal_code.value).length < 6 && chk1.country.value == "IN") {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }
     if (chktrim(chk1.ph_ccode.value).length ==0) {
        alert("Enter Phone Number - Country Code");
        chk1.ph_ccode.focus();
        return false;
     }
     if (!parseInt(chk1.ph_ccode.value)) {
        alert("Incorrect Phone  - Country Code");
        chk1.ph_ccode.focus();
        return false;
     }

     if (chk1.ph_acode.value.length ==0) {
        alert("Enter Phone Number - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (!parseInt(chk1.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (chktrim(chk1.ph_number.value).length ==0) {
        alert("Enter Phone Number");
        chk1.ph_number.focus();
        return false;
     }
     if (!parseInt(chk1.ph_number.value)) {
        alert("Incorrect Phone Number");
        chk1.ph_number.focus();
        return false;
     }*/

	if (member_type!="0" && id1!="tlpd" && id1!="bo" && id1!="em") {
        /*if (chktrim(chk1.bus_ceo.value).length==0) {
            alert("Enter Name of CEO/Owner");
            chk1.bus_ceo.focus();
            return false;
        }
        if (chktrim(chk1.year_estd.value).length<4) {
            alert("Enter Year of Company Establishment (e.g. YYYY )");
            chk1.year_estd.focus();
            return false;
        }
        if (chk1.noof_emp.options[chk1.noof_emp.selectedIndex].value == "0") {
            alert("Select Number of Employees");
            chk1.noof_emp.focus();
            return false;
        }
        if (chk1.turnover.options[chk1.turnover.selectedIndex].value == "0") {
            alert("Select Turnover of Company ");
            chk1.turnover.focus();
            return false;
        } */           
        
        if (chktrim(document.getElementById("product_desc").value).length != 0) {
            alert("Enter Your Product Details");
            document.getElementById("product_desc").focus();
            return false;
        }
        
        if ((!document.getElementById("product_desc").value.indexOf('.com')) || (!document.getElementById("product_desc").value.indexOf('.net')) || (!document.getElementById("product_desc").value.indexOf('.www'))) {
            alert("Don't specify your site address in Product Details fields");
            document.getElementById("product_desc").focus();
            return false;
        }
        
                
        if (chktrim(document.getElementById("product_desc").value).length>350) {
            alert("Enter Product Detail (max. 350 characters)");
            document.getElementById("product_desc").focus();
            return false;
        }

        if (chk1.bus_category.value == "2") {
	        if (chk1.country_deal.value.length==0) {
            	alert("Select Country dealing with ");
            	chk1.country_deal.focus();
            	return false;
        	}
        }
     }
     if (id1=="tlpd") {
        if (chk1.tradelead_type.options[chk1.tradelead_type.selectedIndex].value == "x") {
            alert("Select Trade Lead Type");
            chk1.tradelead_type.focus();
            return false;
        }
        if (chktrim(chk1.quantity.value).length == 0) {
            alert("Do not leave Quantity field blank");
            chk1.quantity.focus();
            return false;
        }
        if (chktrim(chk1.subject.value).length == 0) {
            alert("Do not leave Subject field blank");
            chk1.subject.focus();
            return false;
        }
        if (chktrim(chk1.keywords.value).length == 0) {
            alert("Do not leave Keyword field blank");
            chk1.keywords.focus();
            return false;
        }
        if (chktrim(chk1.details.value).length>250) {
            alert("Your Details limit upto 250 characters");
            chk1.details.focus();
            return false;
        }
        if ((!chk1.details.value.indexOf('.com')) || (!chk1.details.value.indexOf('.net')) || (!chk1.details.value.indexOf('.www'))) {
            alert("Don't specify your site address in Details fields");
            chk1.details.focus();
            return false;
        }
        if (chktrim(chk1.details.value).length < 10) {
            alert("Enter Your Trade Lead Details");
            chk1.details.focus();
            return false;
        }
    }
    if (member_type!="0" && member_type!="1") {
        if ((!chk1.pymt_mode[0].checked) && (!chk1.pymt_mode[1].checked) && (!chk1.pymt_mode[2].checked) && (!chk1.pymt_mode[3].checked) && (!chk1.pymt_mode[4].checked) && (!chk1.pymt_mode[5].checked) && (!chk1.pymt_mode[6].checked) && (!chk1.pymt_mode[7].checked) && (!chk1.pymt_mode[8].checked) && (!chk1.pymt_mode[9].checked) && (!chk1.pymt_mode[10].checked) && (!chk1.pymt_mode[11].checked) && (!chk1.pymt_mode[12].checked)) {
           alert("Please check Your Mode Of Payment");
           chk1.pymt_mode[0].focus();
           return false;
        }
	}
    if (!chk1.iagree.checked) {
    	alert("You must check the Terms & Conditions");
        chk1.iagree.focus();
        return false;
	}
}


function chk_joinnow1(chk1, check_login, id, member_type, id1 ) { // validation on join now second page(first half).somesh

    if (check_login!="true") {
	    
    	if (id!="paid_member" && id!="hp" && id!="new_catg") {
	    	
	    	var validate_password =/^([a-zA-Z0-9])+$/;
	    	
	    	if ((!validate_password.test(chk1.cpassword.value)) && chktrim(chk1.cpassword.value).length >5) {
		        alert("Please do not use Special Character in Password");
		        chk1.cpassword.focus();
		        return false;
			}
	    	
			if (chktrim(chk1.cpassword.value).length <6) {
		        alert("Password must be 6 characters ");
		        chk1.cpassword.focus();
		        return false;
			}
		    if (chktrim(chk1.confirmpassword.value).length <6) {
		        alert("Re-enter Password must be 6 characters ");
		        chk1.confirmpassword.focus();
		        return false;
		    }
		    if ((chk1.cpassword.value) != (chk1.confirmpassword.value)) {
		        alert("Your Password & Re-enter password dosn't match");
		        chk1.cpassword.focus();
		        return false;
		    }
		}
	}
    if (chktrim(chk1.your_name.value).length==0) {
        alert("Enter your name");
        chk1.your_name.focus();
        return false;
    }
    
    //To check .net .com etc words in name field
    if(!isValid(chk1.your_name)) {
    	return false;
 	}
	
	if (member_type!="0" && id1!="tlpd" && id1!="bo" && id1!="em") {
        if (chktrim(chk1.comp_name.value).length==0) {
            alert("Enter your company name");
            chk1.comp_name.focus();
            return false;
        }
        //To check .net .com etc words in company name field
        /*if((chktrim(chk1.comp_name.value).length!=0)&&(!isValid(chk1.comp_name))) {
     		return false;
 		}*/
    
        if (chktrim(chk1.designation.value).length==0) {
            alert("Enter Your Designation at work ");
            chk1.designation.focus();
            return false;
        }
        //To check .net .com etc words in designation field
      	 if((chktrim(chk1.designation.value).length!=0)&&(!isValid(chk1.designation))) {
			return false;
 		}
    }
     if (chktrim(chk1.street_address.value).length ==0) {
        alert("Enter your Street Address");
        chk1.street_address.focus();
        return false;
     }
    //To check .net .com etc words in address field
    if(!isValid(chk1.street_address)) {
    	return false;
 	}
 	
 	if ((chk1.country.value == "IN") &&  (chk1.state_code.options[chk1.state_code.selectedIndex].value == "x")) {
     
        alert("Select your State");
        chk1.state_code.focus();
        return false;
     }
     if (chktrim(chk1.postal_code.value).length == 0) {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }     
     if (chktrim(chk1.postal_code.value).length < 6 && chk1.country.value == "IN") {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }
     
     if (chktrim(chk1.ph_ccode.value).length ==0) {
        alert("Enter Phone Number - Country Code");
        chk1.ph_ccode.focus();
      
          return false;
     }     
     if (!parseInt(chk1.ph_ccode.value)) {
        alert("Incorrect Phone  - Country Code");
        chk1.ph_ccode.focus();
        return false;
     }
     
     if (chktrim(chk1.ph_number.value).length ==0 && chktrim(chk1.mobile_phone.value).length ==0) {
        alert("Enter Your Landline(s) / Mobiles(s) Number ");
        chk1.ph_number.focus();
        return false;
     }
     if (!parseInt(chk1.ph_number.value) && !parseInt(chk1.mobile_phone.value)) {
	     
        alert("Incorrect Landline(s) / Mobiles(s) Number ");
        
        chk1.ph_number.focus();
        return false;
     }


     /*if (chk1.ph_acode.value.length ==0) {
        alert("Enter Phone Number - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (!parseInt(chk1.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (chktrim(chk1.ph_number.value).length ==0) {
        alert("Enter Phone Number");
        chk1.ph_number.focus();
        return false;
     }
     if (!parseInt(chk1.ph_number.value)) {
        alert("Incorrect Phone Number");
        chk1.ph_number.focus();
        return false;
     }*/

	if (member_type!="0" && id1!="tlpd" && id1!="bo" && id1!="em") {
        if (chktrim(chk1.bus_ceo.value).length==0) {
            alert("Enter Name of CEO/Owner");
            chk1.bus_ceo.focus();
            return false;
        }
        if (chktrim(chk1.year_estd.value).length<4) {
            alert("Enter Year of Company Establishment (e.g. YYYY )");
            chk1.year_estd.focus();
            return false;
        }
        if (chk1.noof_emp.options[chk1.noof_emp.selectedIndex].value == "0") {
            alert("Select Number of Employees");
            chk1.noof_emp.focus();
            return false;
        }
        if (chk1.turnover.options[chk1.turnover.selectedIndex].value == "0") {
            alert("Select Turnover of Company ");
            chk1.turnover.focus();
            return false;
        }
        if (chk1.bus_category.options[chk1.bus_category.selectedIndex].value == "x") {
            alert("Select Company Nature of Business ");
            chk1.bus_category.focus();
            return false;
        }
        if (chktrim(chk1.product_desc.value).length>350) {
            alert("Enter Product Detail (max. 350 characters)");
            chk1.product_desc.focus();
            return false;
        }
        if ((!chk1.product_desc.value.indexOf('.com')) || (!chk1.product_desc.value.indexOf('.net')) || (!chk1.product_desc.value.indexOf('.www'))) {
            alert("Don't specify your site address in Product Details fields");
            chk1.product_desc.focus();
            return false;
        }
        if (chktrim(chk1.product_desc.value).length < 10) {
            alert("Enter Your Product Details");
            chk1.product_desc.focus();
            return false;
        }

        if (chk1.bus_category.value == "2") {
	        if (chk1.country_deal.value.length==0) {
            	alert("Select Country dealing with ");
            	chk1.country_deal.focus();
            	return false;
        	}
        }
     }
     if (id1=="tlpd") {
        if (chk1.tradelead_type.options[chk1.tradelead_type.selectedIndex].value == "x") {
            alert("Select Trade Lead Type");
            chk1.tradelead_type.focus();
            return false;
        }
        if (chktrim(chk1.quantity.value).length == 0) {
            alert("Do not leave Quantity field blank");
            chk1.quantity.focus();
            return false;
        }
        if (chktrim(chk1.subject.value).length == 0) {
            alert("Do not leave Subject field blank");
            chk1.subject.focus();
            return false;
        }
        if (chktrim(chk1.keywords.value).length == 0) {
            alert("Do not leave Keyword field blank");
            chk1.keywords.focus();
            return false;
        }
        if (chktrim(chk1.details.value).length>250) {
            alert("Your Details limit upto 250 characters");
            chk1.details.focus();
            return false;
        }
        if ((!chk1.details.value.indexOf('.com')) || (!chk1.details.value.indexOf('.net')) || (!chk1.details.value.indexOf('.www'))) {
            alert("Don't specify your site address in Details fields");
            chk1.details.focus();
            return false;
        }
        if (chktrim(chk1.details.value).length < 10) {
            alert("Enter Your Trade Lead Details");
            chk1.details.focus();
            return false;
        }
    }
    if (member_type!="0" && member_type!="1") {
        if ((!chk1.pymt_mode[0].checked) && (!chk1.pymt_mode[1].checked) && (!chk1.pymt_mode[2].checked) && (!chk1.pymt_mode[3].checked) && (!chk1.pymt_mode[4].checked) && (!chk1.pymt_mode[5].checked) && (!chk1.pymt_mode[6].checked) && (!chk1.pymt_mode[7].checked) && (!chk1.pymt_mode[8].checked) && (!chk1.pymt_mode[9].checked) && (!chk1.pymt_mode[10].checked) && (!chk1.pymt_mode[11].checked) && (!chk1.pymt_mode[12].checked)) {
           alert("Please check Your Mode Of Payment");
           chk1.pymt_mode[0].focus();
           return false;
        }
	}
    if (!chk1.iagree.checked) {
    	alert("You must check the Terms & Conditions");
        chk1.iagree.focus();
        return false;
	}
}

function chk_joinnow_oth(chk1, check_login, id, member_type, id1 ) {
    if (check_login!="true") {
     	if (chktrim(chk1.cpassword.value).length <6) {
	        alert("Password must be 6 characters ");
	        chk1.cpassword.focus();
	        return false;
		}
	    if (chktrim(chk1.confirmpassword.value).length <6) {
	        alert("Re-enter Password must be 6 characters ");
	        chk1.confirmpassword.focus();
	        return false;
	    }
	    if ((chk1.cpassword.value) != (chk1.confirmpassword.value)) {
	        alert("Your Password && Re-enter password dosn't match");
	        chk1.cpassword.focus();
	        return false;
	    }

    	if (chktrim(chk1.your_name.value).length==0) {
        	alert("Enter your name");
        	chk1.your_name.focus();
        	return false;
    	}

        if (chktrim(chk1.comp_name.value).length==0) {
            alert("Enter your company name");
            chk1.comp_name.focus();
            return false;
        }
        if (chktrim(chk1.designation.value).length==0) {
            alert("Enter Your Designation at work ");
            chk1.designation.focus();
            return false;
        }

	     if (chktrim(chk1.street_address.value).length ==0) {
	        alert("Enter your Street Address");
	        chk1.street_address.focus();
	        return false;
	     }
	     if ((chk1.country.value == "IN") &&  (chk1.state.options[chk1.state.selectedIndex].value == "x")) {
	        alert("Select your State");
	        chk1.state.focus();
	        return false;
	     }
	     /*
	     if (chktrim(chk1.postal_code.value).length == 0) {
	        alert("Enter Postal Code");
	        chk1.postal_code.focus();
	        return false;
	     }     
	     
	     if (chktrim(chk1.postal_code.value).length < 6 && chk1.country.value == "IN") {
	        alert("Enter Postal Code");
	        chk1.postal_code.focus();
	        return false;
	     }
	     */
	     if (chktrim(chk1.ph_ccode.value).length ==0) {
	        alert("Enter Phone Number - Country Code");
	        chk1.ph_ccode.focus();
	        return false;
	     }
	     if (!parseInt(chk1.ph_ccode.value)) {
	        alert("Incorrect Phone  - Country Code");
	        chk1.ph_ccode.focus();
	        return false;
	     }
	
	     if (chk1.ph_acode.value.length ==0) {
	        alert("Enter Phone Number - Area Code");
	        chk1.ph_acode.focus();
	        return false;
	     }
	     if (!parseInt(chk1.ph_acode.value)) {
	        alert("Incorrect Phone - Area Code");
	        chk1.ph_acode.focus();
	        return false;
	     }
	     if (chktrim(chk1.ph_number.value).length ==0) {
	        alert("Enter Phone Number");
	        chk1.ph_number.focus();
	        return false;
	     }
	     if (!parseInt(chk1.ph_number.value)) {
	        alert("Incorrect Phone Number");
	        chk1.ph_number.focus();
	        return false;
	     }
     }
     if (id1=="tlpd") {
        if (chk1.tradelead_type.options[chk1.tradelead_type.selectedIndex].value == "x") {
            alert("Select Trade Lead Type");
            chk1.tradelead_type.focus();
            return false;
        }
        if (chktrim(chk1.subject.value).length == 0) {
            alert("Do not leave Subject field blank");
            chk1.subject.focus();
            return false;
        }
        if (chktrim(chk1.quantity.value).length == 0) {
            alert("Do not leave Quantity field blank");
            chk1.quantity.focus();
            return false;
        }
        /*somesh 7-jan-2008
        if (chktrim(chk1.keywords.value).length == 0) {
            alert("Do not leave Keyword field blank");
            chk1.keywords.focus();
            return false;
        }
        */
        if (chktrim(chk1.details.value).length>250) {
            alert("Your Details limit upto 250 characters");
            chk1.details.focus();
            return false;
        }
        if ((!chk1.details.value.indexOf('.com')) || (!chk1.details.value.indexOf('.net')) || (!chk1.details.value.indexOf('.www'))) {
            alert("Don't specify your site address in Details fields");
            chk1.details.focus();
            return false;
        }
        if (chktrim(chk1.details.value).length < 10) {
            alert("Enter Your Trade Lead Details");
            chk1.details.focus();
            return false;
        }
    }
    if(id1!="bo" && id1!="pl") {
		if ((!chk1.pymt_mode[0].checked) && (!chk1.pymt_mode[1].checked) && (!chk1.pymt_mode[2].checked) && (!chk1.pymt_mode[3].checked) && (!chk1.pymt_mode[4].checked) && (!chk1.pymt_mode[5].checked) && (!chk1.pymt_mode[6].checked) && (!chk1.pymt_mode[7].checked) && (!chk1.pymt_mode[8].checked) && (!chk1.pymt_mode[9].checked) && (!chk1.pymt_mode[10].checked) && (!chk1.pymt_mode[11].checked) && (!id1.pymt_mode[12].checked)) {
			alert("Please check Your Mode Of Payment");
        	chk1.pymt_mode[0].focus();
        	return false;
		}
	}
	if(id1!="em") {
		if (chktrim(chk1.email_subject.value).length ==0) {
	        alert("Enter Subject of your E-mail ");
	        chk1.email_subject.focus();
	        return false;
	     }
	     if (chktrim(chk1.email_message.value).length ==0) {
	        alert("Enter Message to be sent in E-mail ");
	        chk1.email_message.focus();
	        return false;
	     }
	}
    if (!chk1.iagree.checked) {
    	alert("You must check the Terms && Conditions");
        chk1.iagree.focus();
        return false;
	}
}

function chk2() {	
	document.joinForm.char_len.value=document.joinForm.product_desc.value.length;
    if (document.joinForm.product_desc.value.length>350) {
    	alert("your text exceed 350 characters");
        document.joinForm.product_desc.focus();
        return false;
	}
}

function chk4() {			
	document.joinForm.char_len.value=document.joinForm.detailReq.value.length;	
    if (document.joinForm.detailReq.value.length>350) {
    	alert("your text exceed 350 characters");
        document.joinForm.detailReq.focus();
        return false;
	}
}

function chk5() {			
	if (chktrim(document.joinForm.detailReq.value).length<=20) {
		alert("Your Message should be minimum 20 characters");
		document.joinForm.detailReq.focus();
		return false;
	}
}
		
function biz_catalog_valid1(chk1, final_category, final_title, prodTy, disp_final_page) {
	if (chktrim(chk1.product_name.value).length==0) {
		alert("Enter Your "+prodTy+" Name");
        chk1.product_name.focus();
        return false;
	}
	if (final_category=="Y") {
		if (chktrim(chk1.full_desc.value).length==0) {
			alert("Enter "+prodTy+" description ");
		    chk1.full_desc.focus();
		    return false;
		}	
		/*
		if (chk1.full_desc.value.length>1000 && chk1.disp_final_page.value=="Y") {
			alert("Your "+prodTy+" description not to exceed 1000 characters");
		    chk1.full_desc.focus();
		    return false;
		}
		*/	
	}
	else if (final_category=="N") {  
		if (chktrim(chk1.full_desc.value).length==0) {
			alert("Enter Your "+prodTy+" Details");
        	chk1.full_desc.focus();
        	return false;
		}
		/*
		if (chk1.full_desc.value.length>1000) {
			alert("Your "+prodTy+" description not to exceed 1000 characters");
		    chk1.full_desc.focus();
		    return false;
		}
		*/				
	}
	else {
		if (disp_final_page!="Y" && final_title!="N") {
			if (chk1.disp_final_page.value=="Y") {
				if (chktrim(chk1.short_desc.value).length==0) {
					alert("Enter "+prodTy+" Short Description ");
				    chk1.short_desc.focus();
				    return false;
				}	
				if (chktrim(chk1.full_desc.value).length==0) {
					alert("Enter "+prodTy+" Full Description ");
				    chk1.full_desc.focus();
				    return false;
				}			
				/*
				if (chk1.short_desc.value.length>1000) {
					alert("Your "+prodTy+" description not to exceed 1000 characters");
				    chk1.short_desc.focus();
				    return false;
				}		
				*/
			}
		}
	}
	if (final_title=="Y") {
		if (!chk1.final_title[0].checked && !chk1.final_title[1].checked && !chk1.final_title[2].checked) {
			alert("Select "+prodTy+" Category Type");
        	chk1.final_title[0].focus();
        	return false;
		}			
	}	
}


function short_bus_listing_valid(chk1) {
	if (chktrim(chk1.product_desc.value).length <= 5) {
    	alert("Enter Your Product Details");
        chk1.product_desc.focus();
		return false;
	}
    if (chktrim(chk1.product_desc.value).length>350) {
    	alert("Enter Product Detail (max. 350 characters)");
        chk1.product_desc.focus();
        return false;
	}
    if ((!chk1.product_desc.value.indexOf('.com')) || (!chk1.product_desc.value.indexOf('.net')) || (!chk1.product_desc.value.indexOf('.www'))) {
    	alert("Don't specify your site address in Product Details fields");
        chk1.product_desc.focus();
        return false;
	}
}	


function return_value_length(formName, fldNameLen, fldNameVal) {
	box1 = eval('document.' + formName + '.' + fldNameLen)
	box2 = eval('document.' + formName + '.' + fldNameVal)	
	box2.value=box1.value.length;
}

function emailValidation(chk1) {
   	if (!chk1.username.value.length) {
       	alert("Please enter your E-Mail");
       	chk1.username.focus();
       	return false;
   	}
   	if (chk1.username.value.indexOf('@') == -1) {
      	alert("Error in E-Mail address");
      	chk1.username.focus();
      	return false;
   	}
   	if (chk1.username.value.indexOf('.') == -1) {
      	alert("Error in E-Mail address");
      	chk1.username.focus();
      	return false;
   	}
}

function validPymtMode(chk1) {
	
	/*
	if (!chk1.pymt_mode[0].checked && !chk1.pymt_mode[1].checked && !chk1.pymt_mode[2].checked && !chk1.pymt_mode[3].checked && !chk1.pymt_mode[4].checked && !chk1.pymt_mode[5].checked && !chk1.pymt_mode[6].checked && !chk1.pymt_mode[7].checked && !chk1.pymt_mode[8].checked && !chk1.pymt_mode[9].checked && !chk1.pymt_mode[10].checked && !chk1.pymt_mode[11].checked && !chk1.pymt_mode[12].checked  ) {
		alert("Please check Your Mode Of Payment.");
        chk1.pymt_mode[0].focus();
        return false;
	}*/
	
	if ((!chk1.mode_opt[0].checked) && (!chk1.mode_opt[1].checked) && (!chk1.mode_opt[2].checked) && (!chk1.mode_opt[3].checked) && (!chk1.mode_opt[4].checked) && (!chk1.mode_opt[5].checked)) {
		
		alert("Please check Your Mode Of Payment");
		
		chk1.mode_opt[0].focus();
		
		return false;
	}
	
	/* Credit Cards Mode */
	if(chk1.mode_opt[0].checked) {
		
		if((!chk1.pymt_mode[0].checked) && (!chk1.pymt_mode[1].checked) && (!chk1.pymt_mode[2].checked)) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[0].focus();
		
			return false;
		}
	}
	
	/* Net Banking Mode */
	if(chk1.mode_opt[1].checked) {
		
		if(!chk1.pymt_mode[3].checked) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[3].focus();
		
			return false;
		}
	}
	
	/* Deposit A Cheque Mode */
	if(chk1.mode_opt[2].checked) {
		
		if((!chk1.pymt_mode[4].checked) && (!chk1.pymt_mode[5].checked) && (!chk1.pymt_mode[6].checked) && (!chk1.pymt_mode[7].checked) && (!chk1.pymt_mode[8].checked) && (!chk1.pymt_mode[9].checked)) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[4].focus();
		
			return false;
		}
	}
	
	/* Paypal Mode */
	if(chk1.mode_opt[3].checked) {
		
		if(!chk1.pymt_mode[10].checked) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[10].focus();
		
			return false;
		}
	}
	
	/* Mobile Phone Mode */
	if(chk1.mode_opt[4].checked) {
		
		if(!chk1.pymt_mode[11].checked) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[11].focus();
		
			return false;
		}
		if (chk1.pymt_mode[11].checked && chktrim(chk1.mobile_phone.value).length ==0) {
		
			alert("Please Enter Your Mobile Number");
			chk1.mobile_phone.focus();
			return false;
		}
	}
	
	/*Other Online Payment Option Mode */
	if(chk1.mode_opt[5].checked) {
		
		if(!chk1.pymt_mode[12].checked) {
			
			alert("Please check Your Payment Options");
		
			chk1.pymt_mode[12].focus();
		
			return false;
		}
	}
}


function biz_home_valid(chk1) {
	if (chk1.your_name.value.length==0) {
            alert("Enter your name");
            chk1.your_name.focus();
            return false;
    }
    if (chk1.comp_name.value.length==0) {
       alert("Enter your company name");
       chk1.comp_name.focus();
       return false;
	}
    if (chk1.address.value.length ==0) {
    	alert("Enter your Postal Address");
        chk1.address.focus();
        return false;
	}
    if (chk1.country.options[chk1.country.selectedIndex].value=="")  {
    	alert("Enter your Country");
        chk1.country.focus();
        return false;
	}
    if (chk1.phone.value.length==0)  {
    	alert("Enter your Phone Number");
        chk1.phone.focus();
        return false;
	}
    if (chk1.username.value.length == 0) {
    	alert("E-mail address can't be left blank");
        chk1.username.focus();
        return false;
	}
    if (chk1.username.value.indexOf('@') == -1) {
    	alert("Error in e-mail address");
        chk1.username.focus();
               return false;
         }
         if (chk1.username.value.indexOf('.') == -1) {
               alert("Error in e-mail address");
               chk1.username.focus();
               return false;
         }
         if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
               alert("Please Specify One E-mail address only");
               chk1.username.focus();
               return false;
         }
	if (chk1.your_requirement.value.length==0)  {
            alert("Enter Your Requirement");
        	chk1.your_requirement.focus();
			return false;
    }
}


function hp_oth_detl(chk1, var1) {
	if (var1=="Y") {
		if (chktrim(chk1.othername.value).length >20) {
        	alert("Unable to submit !! Section Name (limit upto 20 characters)");
            chk1.othername.focus();
            return false;
		}
        if ((chk1.othsec.value=="Other") && (!chktrim(chk1.othername.value).length)) {
			alert ("Please Do Not Leave The Section Name Field Blank !!");
		  	chk1.othername.focus();
		  	return false;
		}
	}
	else {
    	if (!chktrim(chk1.section_name.value).length) {
			alert ("Please Do Not Leave The 1Section Name Field Blank !!");
			chk1.section_name.focus();
			return false;
		}
	}
	/*
    if (chktrim(chk1.sec_detail.value).length >1000) {
    	alert("Unable to submit !! Section Details (limit upto 1000 characters)");
        chk1.sec_detail.focus();
        return false;
	}
	*/
    if (!chktrim(chk1.sec_detail.value).length) {
		alert ("Please Do Not Leave The Section Detail Field Blank !!");
		chk1.sec_detail.focus();
		return false;
	}
}

function validHPAB(chk1) {
	if (chktrim(chk1.company.value).length==0) {
		alert("Unable to submit !! Company should not be blank");
		chk1.company.focus();
        return false;
	}	       	
	if (chktrim(chk1.bus_type.value).length==0) {
    	alert("Unable to submit !! Business Type should not be blank");
        chk1.bus_type.focus();
        return false;
	}	       	          	
	if (chktrim(chk1.about_company.value).length > 2000 && chktrim(document.freelist.about_company.value).length< 250) {
    	alert("Unable to submit !! About Company (limit between 250 and 2000 characters)");
        chk1.about_company.focus();
        return false;
	}
	if (chk1.slogan.value.length > 64 ) {
  		alert("Unable to submit !! Company Slogan (Maximum characters Used 64)");
  	 	chk1.slogan.focus();
  	 	return false; 
	}
}

function bh_prod_detl (chk1, chk_about) {
	if (chk_about=="Y") {
		if (chktrim(chk1.about_product.value).length >2000) {
    		alert("Unable to submit !! Section Name (limit upto 2000 characters)");
        	chk1.about_product.focus();
        	return false;
		}
	}
	else {
    	if (chktrim(chk1.product_name.value).length==0) {
    		alert("Enter Your Product Name");
        	chk1.product_name.focus();
        	return false;
		}
    	if (chktrim(chk1.full_desc.value).length==0) {
    		alert("Enter Your Product Details");
        	chk1.full_desc.focus();
        	return false;
		}
	}
}

function htmlFormLogin() {
	if (document.form12.user_name.value.length == 0) {
    	alert("E-mail address can't be left blank");
		document.form12.user_name.focus();
        return false;
	}
    if (document.form12.user_name.value.indexOf('@') == -1) {
    	alert("Error in e-mail address");
		document.form12.user_name.focus();
        return false;
	}
    if (document.form12.user_name.value.indexOf('.') == -1) {
    	alert("Error in e-mail address");
        document.form12.user_name.focus();
        return false;
	}
    if (document.form12.user_name.value.indexOf('@') != document.form12.user_name.value.lastIndexOf('@')) {
    	alert("Please Specify One E-mail address only");
        document.form12.user_name.focus();
        return false;
	}
    if (document.form12.pass_word.value.length==0) {
    	alert("Enter Your Password ");
        document.form12.pass_word.focus();
        return false;
	}
    document.form12.id.value='';
    document.form12.id2.value='login';
    document.form12.submit();
}

function disable_search_form(joinow_select) {
	var flag=false;

	if (document.joinow_select.member_type[1].checked) 	{
		flag=true;
	}
	else 	{
		flag=false;
	}

	document.joinow_select.bus_category.disabled=flag;
	return true;
}

function enquiryValid (loginChk, formChk, chkTy) {
	
	if (chkTy!="N") {
		
		/*if (document.form1.kword.value.length<5 || document.form1.kword.value.length>100){
	    	if (document.form1.kword.value.length>100){
	    		alert("Your Inquiry Subject [ maximum 100 characters ] ");
			}
			else {
	    		alert("Enter your Inquiry Subject [ minimum 5 characters ] ");
			}
	        document.form1.kword.focus();
	        return (false);
		}*/
		
		if (document.form1.detail_req.value.length<10 || document.form1.detail_req.value.length>1000){
			
	    	if (document.form1.detail_req.value.length>1000){
		    	
	    		alert("Your Requirement Details [ maximum 1000 characters ] ");
			}
			else {
				
	    		alert("Please enter your Requirement Details [ minimum 10 characters ] ");
			}
			
	        document.form1.detail_req.focus();
	        
	        return (false);
		}
		
		/*if (document.form1.captcha.value.length==0) {
			
    		alert("Please Enter Security Code");
        	document.form1.captcha.focus();
        	return false;
		}*/
		
	}
	if (loginChk=="Y") {
		
		pp = chk_login(document.form1);
		document.form1.id3.value="Send Inquiry";
	}
	else if (formChk=="Y") {
		
		pp = guestMemValid(document.form1);	
			
		if (pp==false) {
					
			return false;
		}
		else {
	   		if (document.form1.bus_ty.options[document.form1.bus_ty.selectedIndex].value=="")  {
		   		alert("select Nature of Business Type");
		   		document.form1.bus_ty.focus();
		   		return false;
	   		}
	   		if (document.form1.bus_ty.options[document.form1.bus_ty.selectedIndex].value!="x" && document.form1.comp_name.value.length==0) {	   		
				alert("Enter Company Name");	
		   		document.form1.comp_name.focus();
		   		return false;		   		
	   		}	   		
	   		if (document.form1.bus_ty.options[document.form1.bus_ty.selectedIndex].value!="x") {
	   			if (document.form1.product_desc.value.length<10) {
		   			alert("Enter Products/Services Detail ");		   			
	   				document.form1.product_desc.focus();
		   			return false;	 			
	   			}
	   			else if (document.form1.product_desc.value.length>350) {
		   			alert("Enter Products/Services Detail not exceed 350 characters");	
	   				document.form1.product_desc.focus();
		   			return false;		   			
	   			}
	
	   		}
   		}		
		document.form1.id4.value="Send Inquiry";		
	}
	else {
		var pp="true";
	}
	if (pp !=false || pp=="true") {
		if (chkTy=="N" && formChk=="N") {
			document.form1.id1.value="checkLogin";					
		}
		else if (chkTy=="N" && loginChk=="N") {
			document.form1.id1.value="newUser";					
		}			
		document.form1.submit();
	}
}


function CallFreeValid (loginChk, formChk, chkTy) {
	
	if (loginChk=="Y") {
		
		pp = chk_login(document.form1);
		
		document.form1.id3.value="Call Now";
		
	}
	else if (formChk=="Y") {
		
		pp = CallFreeguestMemValid(document.form1);		
		
		if (pp==false) {		
			
			return false;
		}				
		document.form1.id4.value="Call Now";		
	}
	else {
		var pp="true";
	}
	
	if (pp !=false || pp=="true") {
		
		if (chkTy=="N" && formChk=="N") {
			
			document.form1.id1.value="checkLogin";					
		}
		else if (chkTy=="N" && loginChk=="N") {
			
			document.form1.id1.value="newUser";					
		}			
		document.form1.submit();
	}
}

function CallFreeguestMemValid (id1) { //function when member search the party and he is not logged in or a guest member.somesh
	
	//alert(id1.your_name_visitor.value);
   	if (chktrim(id1.your_name_visitor.value).length==0) {
      	alert("Enter your name");
	  	id1.your_name_visitor.focus();
      	return false;
   	}
   	 //To check .net .com etc words in name field
    if(!isValid(id1.your_name_visitor)) {
   		return false;
	}
   	 //To check .net .com etc words in Email ID field
    if(isProhibited(id1.username_visitor)) {
   		return false;
	}
	if (chktrim(id1.username_visitor.value).length == 0) {
      	alert("E-mail address can't be left blank");
      	id1.username_visitor.focus();
      	return false;
   	}
   	if (id1.username_visitor.value.indexOf('@') == -1) {
      	alert("Error in e-mail address");
      	id1.username_visitor.focus();
      	return false;
   	}
   	if (id1.username_visitor.value.indexOf('.') == -1) {
      	alert("Error in e-mail address");
      	id1.username_visitor.focus();
      	return false;
   	}
   	if (id1.username_visitor.value.indexOf('@') != id1.username_visitor.value.lastIndexOf('@')) {
      	alert("Please Specify One E-mail address only");
      	id1.username_visitor.focus();
      	return false;
   	}   	
   	
   	if (id1.country_visitor.options[id1.country_visitor.selectedIndex].value=="")  {
	   	
      	alert("Select your Country");
      	
      	id1.country_visitor.focus();
      	
      	return false;
   	}   
     
	if (chktrim(id1.mobile_phone_visitor.value).length ==0) {
	
		alert("Enter Your Mobile Number ");
		
		id1.mobile_phone_visitor.focus();
		
		return false;
	}            
}



function guestMemValid (id1) { //function when member search the party and he is not logged in or a guest member.somesh
	
   	if (chktrim(id1.your_name.value).length==0) {
      	alert("Enter your name");
	  	id1.your_name.focus();
      	return false;
   	}
   	 //To check .net .com etc words in name field
    if(!isValid(id1.your_name)) {
   		return false;
	}
   	 //To check .net .com etc words in Email ID field
    if(isProhibited(id1.username)) {
   		return false;
	}
	if (chktrim(id1.username.value).length == 0) {
      	alert("E-mail address can't be left blank");
      	id1.username.focus();
      	return false;
   	}
   	if (id1.username.value.indexOf('@') == -1) {
      	alert("Error in e-mail address");
      	id1.username.focus();
      	return false;
   	}
   	if (id1.username.value.indexOf('.') == -1) {
      	alert("Error in e-mail address");
      	id1.username.focus();
      	return false;
   	}
   	if (id1.username.value.indexOf('@') != id1.username.value.lastIndexOf('@')) {
      	alert("Please Specify One E-mail address only");
      	id1.username.focus();
      	return false;
   	}   	
   	if (chktrim(id1.comp_name.value).length == 0) {
      	alert("Company Name can't be left blank");
      	id1.comp_name.focus();
      	return false;
   	}
   	/*if(!isValid(id1.comp_name)) {
   		return false;
	}*/
	
	if (chktrim(id1.address.value).length ==0) {
      	alert("Enter Street Address");
      	id1.address.focus();
      	return false;
   	}
   	
   	if (id1.country.options[id1.country.selectedIndex].value=="")  {
      	alert("Select your Country");
      	id1.country.focus();
      	return false;
   	}
   	   	
   	//To check .net .com etc words in address field
   	if(!isValid(id1.address)) {
   		return false;
	}
	
	if (id1.ph_ccode.value.length ==0) {
        alert("Enter Phone Number - Country Code");
        id1.ph_ccode.focus();
        return false;
     }
     
     /*if (!parseInt(id1.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        id1.ph_acode.focus();
        return false;
     }*/
     
     if (chktrim(id1.ph_number.value).length ==0 && chktrim(id1.mobile_phone.value).length ==0) {	     
        alert("Enter Your Landline(s) / Mobile(s) Number ");
        id1.ph_number.focus();
        return false;
     }            
}

function valid(chk) {
	if (chk.username.value.length == 0) {
		alert("E-mail address can't be left blank");
		chk.username.focus();
	    return false;
	}
   	if (chk.username.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
	    chk.username.focus();
	    return false;
	}
	if (chk.username.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
	    chk.username.focus();
	    return false;
	}
	if (chk.username.value.indexOf('@') != chk.username.value.lastIndexOf('@')) {
		alert("Please Specify One E-mail address only");
	    chk.username.focus();
	    return false;
	}
	 return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function isValid(obj){ //function to validate hotmail,gmail etc in your name,company name etc field in search and join now pages.somesh
	var objval=obj.value;
    invalidstr = new Array("hotmail", "gmail", "indiatimes", "rediffmail", "yahoo", ".com", ".net",".org", ".co.in", ".co.cn", ".co.ca", ".gov", ".co.uk");
		 		
	for(i=0;i<invalidstr.length;i++){
		if (chktrim(objval).toLowerCase().indexOf(chktrim(invalidstr[i]).toLowerCase())>=0){	
			alert("Please don't use "+invalidstr[i]+".") 
			obj.focus();
			return false;		
		}
	}
	return true;
}//end of isValid

function isProhibited(obj){  //function to validate indiamart,india mart,alibaba,ali baba,tradeindia,trade-india in your name,company name etc field in search and join now pages.somesh
	var objval=obj.value;
	//invalidstr=new Array("indiamart","india mart", "alibaba","ali baba","tradeindia", "trade-india" ,"nissi");
	invalidstr=new Array("indiamart","india mart", "alibaba","ali baba","tradeindia", "trade-india");
	for(i=0;i<invalidstr.length;i++){
		if (chktrim(objval).toLowerCase().indexOf(chktrim(invalidstr[i]).toLowerCase())>=0){	
			alert("Please use Email ID other than "+invalidstr[i]+".") 
			obj.focus();
			return true;		
		}
	}
	return false;
}//end of isProhibited()

function chkpostlead() {
	if ((freelist.product_desc.value).length>350) {
    	alert("Enter Original Description (max. 350 characters)");
        freelist.product_desc.focus();
        return false;
	}
}	

function validMetaUrl(chk) { // validation meta tag url
	alert(chk.url[0].value);
}//end validation meta tag url

function valid_vanity_register(chk1) {
	if (chktrim(chk1.user_name.value).length == 0) {
    	alert("E-mail address can't be left blank");
		chk1.user_name.focus();
        return false;
	}
    if (chk1.user_name.value.indexOf('@') == -1) {
    	alert("Error in e-mail address");
		document.form12.user_name.focus();
        return false;
	}
    if (chk1.user_name.value.indexOf('.') == -1) {
    	alert("Error in e-mail address");
        document.form12.user_name.focus();
        return false;
	}
    if (chk1.user_name.value.indexOf('@') != chk1.user_name.value.lastIndexOf('@')) {
    	alert("Please Specify One E-mail address only");
        chk1.user_name.focus();
        return false;
	}
    if (chk1.pass_word.value.length==0) {
    	alert("Enter Your Password ");
        chk1.pass_word.focus();
        return false;
	}
    if (chk1.pass_word.value != chk1.cpass_word.value) {
         alert("Password && Confirm Password fields differ");
         chk1.cpass_word.focus();
         return false;
	}
    if (chktrim(chk1.your_name.value).length==0) {
        alert("Enter your name");
        chk1.your_name.focus();
        return false;
    }
    
    //To check .net .com etc words in name field
    if(!isValid(chk1.your_name)) {
    	return false;
 	}
    if (chktrim(chk1.comp_name.value).length==0) {
        alert("Enter your company name");
        chk1.comp_name.focus();
        return false;
    }
    if(!isValid(chk1.comp_name)) {
    	return false;
 	}
    if (chktrim(chk1.designation.value).length==0) {
        alert("Enter Your Designation at work ");
        chk1.designation.focus();
        return false;
    }
    //To check .net .com etc words in designation field
  	 if((chktrim(chk1.designation.value).length!=0)&&(!isValid(chk1.designation))) {
		return false;
		}
	if ((chk1.country.options[chk1.country.selectedIndex].value == "x")) {
        alert("Select Your Country");
        chk1.country.focus();
        return false;	
	}
     if (chktrim(chk1.street_address.value).length ==0) {
        alert("Enter your Street Address");
        chk1.street_address.focus();
        return false;
     }
     
    //To check .net .com etc words in address field
    if(!isValid(chk1.street_address)) {
    	return false;
 	}

	if (chk1.country.value == "IN" &&  chk1.state.options[chk1.state.selectedIndex].value == "x") {
        alert("Select your State");
        chk1.state.focus();
        return false;
     }
     if (chktrim(chk1.postal_code.value).length == 0) {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }     
     if (chktrim(chk1.postal_code.value).length < 6 && chk1.country.value == "IN") {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }
     if (chktrim(chk1.ph_ccode.value).length ==0) {
        alert("Enter Phone Number - Country Code");
        chk1.ph_ccode.focus();
        return false;
     }
     if (!parseInt(chk1.ph_ccode.value)) {
        alert("Incorrect Phone  - Country Code");
        chk1.ph_ccode.focus();
        return false;
     }

     if (chk1.ph_acode.value.length ==0) {
        alert("Enter Phone Number - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (!parseInt(chk1.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        chk1.ph_acode.focus();
        return false;
     }
     if (chktrim(chk1.ph_number.value).length ==0) {
        alert("Enter Phone Number");
        chk1.ph_number.focus();
        return false;
     }
     if (!parseInt(chk1.ph_number.value)) {
        alert("Incorrect Phone Number");
        chk1.ph_number.focus();
        return false;
     }

 
    if (chk1.bus_category.options[chk1.bus_category.selectedIndex].value == "x") {
        alert("Select Company Nature of Business ");
        chk1.bus_category.focus();
        return false;
    }
    if (chktrim(chk1.product_desc.value).length<10) {
        alert("Enter Product Detail");
        chk1.product_desc.focus();
        return false;
	}
    if (chktrim(chk1.product_desc.value).length>350) {
        alert("Enter Product Detail (max. 350 characters)");
        chk1.product_desc.focus();
        return false;
    }
    if ((!chk1.product_desc.value.indexOf('.com')) || (!chk1.product_desc.value.indexOf('.net')) || (!chk1.product_desc.value.indexOf('.www'))) {
        alert("Don't specify your site address in Product Details fields");
        chk1.product_desc.focus();
        return false;
    }
    if (!chk1.iagree.checked) {
    	alert("You must check the Terms & Conditions");
        chk1.iagree.focus();
        return false;
	}
}
function valid_feedback_form(chk1) {
   if (chktrim(chk1.your_name.value).length==0) {
      alert("Enter Your Name");
      chk1.your_name.focus();
      return false;
   }
   if (chktrim(chk1.username.value).length == 0) {
      alert("E-mail address can't be left blank");
      chk1.username.focus();
      return false;
   }
   if (chk1.username.value.indexOf('@') == -1) {
      alert("Error in e-mail address");
      chk1.username.focus();
      return false;
   }
   if (chk1.username.value.indexOf('.') == -1) {
      alert("Error in e-mail address");
      chk1.username.focus();
      return false;
   }
   if (chk1.username.value.indexOf('@') != chk1.username.value.lastIndexOf('@')) {
      alert("Please Specify One E-mail address only");
      chk1.username.focus();
      return false;
   }  
   if (chktrim(chk1.phone.value).length == 0) {
      alert("Phone number can't be left blank");
      chk1.phone.focus();
      return false;
   }
   
   if (chk1.subject.options[chk1.subject.selectedIndex].value == "x") {
      alert("Select Subject");
      chk1.subject.focus();
      return false;
   }
   if (chktrim(chk1.comments.value).length<10) {
      alert("Enter Your Comments");
      chk1.comments.focus();
      return false;
   }
}
function contact_us_validation() {
	
   if (document.joinForm.your_name.value.length==0) {
      alert("Enter Your Name");
      document.joinForm.your_name.focus();
      return false;
   }
   
   if (document.joinForm.country.options[document.joinForm.country.selectedIndex].value == "x") {
      alert("Select Country");
      document.joinForm.country.focus();
      return false;
   }
   
	if (document.joinForm.phone.value.length ==0) {
		alert("Enter Phone Number");
		document.joinForm.phone.focus();
		return false;
	}
   
   if (document.joinForm.username.value.length == 0) {
      alert("E-mail address can't be left blank");
      document.joinForm.username.focus();
      return false;
   }
   if (document.joinForm.username.value.indexOf('@') == -1) {
      alert("Error in e-mail address");
      document.joinForm.username.focus();
      return false;
   }
   if (document.joinForm.username.value.indexOf('.') == -1) {
      alert("Error in e-mail address");
      document.joinForm.username.focus();
      return false;
   }
   if (document.joinForm.username.value.indexOf('@') != document.joinForm.username.value.lastIndexOf('@')) {
      alert("Please Specify One E-mail address only");
      document.joinForm.username.focus();
      return false;
   }  
   
   if (document.joinForm.subject.options[document.joinForm.subject.selectedIndex].value == "x") {
      alert("Select Subject");
      document.joinForm.subject.focus();
      return false;
   }  
	
	if (document.joinForm.captcha.value.length==0) {				
		alert("Please Enter Confirmation Code");
		document.joinForm.captcha.focus();
		return false;
	}
   
   if (document.joinForm.comments.value.length<10) {
      alert("Enter Your Comments");
      document.joinForm.comments.focus();
      return false;
   }
}

// For opening website through redirect.php.somesh
function site_url(slno, url) {
  popupWin = window.open(''+url+'/redirect.php?slno='+slno+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
}
function trade_inq(var1) {
  popupWin = window.open('/trade/trade-search.php?id=enq_detl&slno='+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
}

function clsiified_inq(var1, site_ty) {
	if (site_ty=="live") {
  		popupWin = window.open('http://www.exportersindia.com/members/search.php?'+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
	}
	else {
  		popupWin = window.open('http://192.168.1.106/members/search.php?'+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');		
	}	
}

function trade_detl(var1, sty) {
	window.location='/trade/trade-search.php?id=detail&pty_ids='+var1+'&sty='+sty+'';
}

function show_url(var1, site_ty) {
	
	if (site_ty=="live") {
		
  		popupWin = window.open('http://www.exportersindia.com/members/show-url.php?id=wwwicon&member_id='+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
	}
	else if (site_ty=="live1") {
		
  		popupWin = window.open('http://74.84.129.4/members/show-url.php?id=wwwicon&member_id='+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
	}	
	else {
  		popupWin = window.open('http://192.168.1.106/members/show-url.php?id=wwwicon&member_id='+var1+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');		
	}
}

function b2b_search(chk1) {	

	if (chk1.term.value=="" || chk1.term.value=="Enter Keywords here . . ." ) {		
  		alert("Enter Tradelead Keyword");
  		chk1.term.focus();
  		return false;
	}
}

function valid_email(chk1) {
	if (chk1.new_email.value.length == 0) {
		alert("E-mail address can't be left blank");
		chk1.new_email.focus();
		return false;
	}
	//To check .net .com etc words in Email ID field
    if(isProhibited(chk1.new_email)) {
   		return false;
	}
	if (chk1.new_email.value.indexOf('@') == -1) {
		alert("Error in e-mail address");
		chk1.new_email.focus();
	    return false;
	}
	if (chk1.new_email.value.indexOf('.') == -1) {
		alert("Error in e-mail address");
		chk1.new_email.focus();
		return false;
	}
	if (chk1.new_email.value.indexOf('@') != chk1.new_email.value.lastIndexOf('@')) {
		alert("Please Specify One E-mail address only");
		chk1.new_email.focus();
	    return false;
	}  
	if (chk1.reason_for_change.value.length <1) {
		alert("Please Enter Reason For Change In Email ID");
		chk1.reason_for_change.focus();
	    return false; 
	}
	if (chk1.reason_for_change.value.length >500) {
		alert("Please Enter Reason For Change In Email ID within 500 characters");
		chk1.reason_for_change.focus();
	    return false; 
	}
}

// For Showing banner example in Banner Advertising section.somesh
function show_banner(banner_size, url) {
	popupWin = window.open(''+url+'/images_1/'+banner_size+'.gif', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');		
}

// For Vtrust popup used in members/search.php.somesh
function show_vtrust(mi, url) {
	popupWin = window.open(''+url+'popup/popup-trustcode.php?mi='+mi+'', 'newwin', 'toolbar=no,directories=no,scrollbars=yes,resizable=0,status=no,menubar=0,width=560,height=500');		
}
// validate guest and paid members.brijesh paid_status=0 for Guest aand paid_status>0 as business member
function chk_active_member() {
    
     if (document.joinForm.your_name.value.length==0) {
		   alert("Enter your name");
		   document.joinForm.your_name.focus();
		   return false;
	   }
	   if (document.joinForm.paid_status.value>0) {
		    if (document.joinForm.comp_name.value.length==0) {
			   alert("Enter your company name");
			   document.joinForm.comp_name.focus();
			   return false;
		   }
	   }
	    
	   if (document.joinForm.street_address.value.length ==0) {
		   alert("Enter your Street Address");
		   document.joinForm.street_address.focus();
		   return false;
	   }
	   if (document.joinForm.postal_code.value.length ==0) {
		   alert("Enter  Postal Code");
		   document.joinForm.postal_code.focus();
		   return false;
	   }
	   if (document.joinForm.ph_number.value.length ==0) {
		   alert("Enter Phone Number");
		   document.joinForm.ph_number.focus();
		   return false;
	   }
	   if (!parseInt(document.joinForm.ph_number.value)) {
		   alert("Incorrect Phone Number");
		   document.joinForm.ph_number.focus();
		   return false;
	   }
	   if (document.joinForm.ph_acode.value.length ==0) {
		   alert("Enter Phone Number - Area Code");
		   document.joinForm.ph_acode.focus();
		   return false;
	   }
	   if (document.joinForm.ph_ccode.value.length ==0) {
		   alert("Enter Phone Number - Country Code");
		   document.joinForm.ph_ccode.focus();
		   return false;
	   }
	   if (document.joinForm.id4.value =="free") {
		   if (document.joinForm.username.value.length == 0) {
			   alert("E-mail address can't be left blank");
			   document.joinForm.username.focus();
			   return false;
		   }
		   if (document.joinForm.username.value.indexOf('@') == -1) {
			   alert("Error in e-mail address");
			   document.joinForm.username.focus();
			   return false;
		   }
		   if (document.joinForm.username.value.indexOf('.') == -1) {
			    alert("Error in e-mail address");
			    document.joinForm.username.focus();
			    return false;
		    }
		    if (document.joinForm.username.value.indexOf('@') != document.joinForm.username.value.lastIndexOf('@')) {
			    alert("Please Specify One E-mail address only");
			    document.joinForm.username.focus();
			    return false;
		    }
	    }
}

// For opening website through redirect.php where website name is encypted through php.Encrypted website name is stored in variable encyptedurl.somesh
function encrypted_url(encyptedurl, url) {
  popupWin = window.open(''+url+'/redirect.php?encyptedurl='+encyptedurl+'', 'newwin', 'menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
}

function card_test() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "checkbox") && (dml.elements[i].checked==true)) {
         pp=2;
      }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.id.value="view";
      	document.form1.target="_blank";
      	document.form1.submit();
   }
}

function card_test1() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "checkbox") && (dml.elements[i].checked==true)) {
         pp=2;
      }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.id.value="update";
      	document.form1.target="_blank";
      	document.form1.submit();
   }
}

function card_test2() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if ((document.form1.elements[i].type == "checkbox") && (dml.elements[i].checked==true)) {
         pp=2;
      }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.id.value="update1";
      	document.form1.target="_blank";
      	document.form1.submit();
   }
}

//////////////  use only in cpaid_feature.php dipa/////////
function chk_feature() {
	if (document.form1.Url.value.length == 0) {
		alert("Do not leave Url field blank");
		document.form1.Url.focus();
		return false;
	}
	if (document.form1.feature_desc.value.length==0) {
		alert("Do not leave Details field blank");
		document.form1.feature_desc.focus();
		return false;
	}
}
function chk3() {
	
	document.form1.char_len.value=document.form1.feature_desc.value.length;
    if (document.form1.feature_desc.value.length>150) {
    	alert("your text exceed 150 characters");
        document.form1.feature_desc.focus();
        return false;
	}
}
//function added by dipa to chk image size usd in cpaid_feature1.php
function chkimg(pathField)
{ 
	var imgRe = /^.+\.(jpg|jpeg|gif|png)$/i;
	var path = pathField.value;
	if(path!="") {
		if (path.search(imgRe) != -1)
		{ 
			//document[previewName].src = 'file://'+path;
			var img = new Image();
			img.src = 'file://'+path;
			//alert(img.width + ' pixels wide x ' + img.height +' pixels high');
			if(img.width>120 || img.height>120) {
				alert("Sorry Image size is too large");
				pathField.focus();
				return false;
			}
			/*else {
				alert("Ok");
			}*/
	
		} 
		else 
		{ 
			alert("JPG, PNG, and GIFs only!");
			pathField.focus();
			return false;
		} 
	}
}


////////////////////////////////ajax chk//////////////
var xmlHttp 
function Check_Availability1(url, displayitem) {	
	
	xmlHttp=GetXmlHttpObject();
	
	//document.getElementById(displayitem).innerHTML="Loading............";
	if (xmlHttp==null) {	
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	url =url+"&sid="+Math.random();		
	xmlHttp.onreadystatechange=function stateChanged() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {			
			if(xmlHttp.responseText.length>0) {		
					
				document.getElementById("txtHint").innerHTML=xmlHttp.responseText;							
				
				if (xmlHttp.responseText=="<font color=red>incorrect Email ID</font>" || xmlHttp.responseText=="<font color=red>Email ID already exist.</font>") {			
					
					document.joinForm.username.focus();
					
					document.getElementById('txtHint').style.display = 'block'; 
					return false;
				}
			}
			else {
				document.getElementById("txtHint").innerHTML="";
				
				document.getElementById('txtHint').style.display = 'none'; 
			}
		}
	};
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function GetXmlHttpObject() {	
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
return xmlHttp;
}

function ajax(url, elementname) {
	
	xmlHttp = GetXmlHttpObject();
	
	if (xmlHttp==null) {
		
		alert ("Your browser does not support AJAX!");
		
		return;
	} 	
	
	xmlHttp.onreadystatechange=function chkdublicate(){
		
		if(xmlHttp.readyState==4){			
			
			if(elementname=='isdid' && xmlHttp.responseText.length>0) {//put isdcode
				
				document.getElementById('isdid').value=xmlHttp.responseText;

			}
			else {
				
				document.getElementById('isdid').value=xmlHttp.responseText;

				//ocument.getElementById(''+elementname+'').innerHTML=xmlHttp.responseText;
			}			
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}




function showme(val) {
	 if(val=="e") {
		document.getElementById('exis_div').style.display = 'block'; 
		document.getElementById('newmem_div').style.display = 'none'; 
	 }
	 else if(val=="n") {
		
		document.getElementById('exis_div').style.display = 'none'; 
		document.getElementById('newmem_div').style.display = 'block'; 
	 }
}

function select_pos(val) {
	
	alert("brijesh");
	
	alert(val);
	
	/*if(val=="e") {
		document.getElementById('exis_div').style.display = 'block'; 
		document.getElementById('newmem_div').style.display = 'none'; 
	 }
	 else if(val=="n") {
		
		document.getElementById('exis_div').style.display = 'none'; 
		document.getElementById('newmem_div').style.display = 'block'; 
	 }*/
}

function treeOpacityDefault() {	
	abc=document.getElementById("tree");	
	abc.style.opacity = 5;
	abc.style.filter = 'alpha(opacity=50)';
}

function treeOpacityOver() {	
	abc=document.getElementById("tree");
	abc.style.opacity = 1;
	abc.style.filter = 'alpha(opacity=100)';
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
/** 
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
*/


function setWidth() {
	var screenWidth=screen.width;
	if(screenWidth>=1024) {
		document.getElementById('body').style.width='990px';
	}
	else {
		document.getElementById('body').style.width='770px';
	}	
}

function setWidth_new() {
	
	if(screen.width>1024) {
		document.getElementById('body').style.width='1000px';
	}
}

function trade_chk_joinnow() {
	if (chktrim(document.joinForm.detailReq.value).length<=20) {
		alert("Your Message should be minimum 20 characters");
		document.joinForm.detailReq.focus();
		return false;
	}			
	
	if (chktrim(document.joinForm.your_name.value).length==0) {
		alert("Enter your name");
		document.joinForm.your_name.focus();
		return false;
	}	
	
	if (chktrim(document.joinForm.comp_name.value).length==0) {
		alert("Enter your company name");
		document.joinForm.comp_name.focus();
		return false;
	}
	
	if (chktrim(document.joinForm.username.value).length == 0) {
		alert("E-mail ID can't be left blank");
		document.joinForm.username.focus();
		return false;
	}				
	
	if (document.joinForm.username.value.indexOf('@') == -1) {
		alert("Error in Email ID");
		document.joinForm.username.focus();
		return false;
	}
	if (document.joinForm.username.value.indexOf('.') == -1) {
		alert("Error in Email ID");
		document.exist_user.user_name.focus();
		return false;
	}
	if (document.joinForm.username.value.indexOf('@') !=  document.joinForm.username.value.lastIndexOf('@')) {
		alert("Please Specify One Email ID only");
		document.joinForm.username.focus();
		return false;
	}	
	
	if (chktrim(document.joinForm.password.value).length==0) {
		alert("Enter your Password");
		document.joinForm.password.focus();
		return false;
	}		
	
	if (document.joinForm.country.options[document.joinForm.country.selectedIndex].value=="")  {
      	alert("Select your Country");
      	document.joinForm.country.focus();
      	return false;
   	}
	
	if (chktrim(document.joinForm.street_address.value).length ==0) {
		alert("Enter your Street Address");
		document.joinForm.street_address.focus();
		return false;
	}
	if (!parseInt(document.joinForm.ph_ccode.value)) {
		alert("Incorrect Phone  - Country Code");
		document.joinForm.ph_ccode.focus();
		return false;
	}
	
	if (chktrim(document.joinForm.ph_ccode.value).length ==0) {
		alert("Enter Phone Number - Country Code");
		document.joinForm.ph_ccode.focus();
		return false;
	}
	
	if (chktrim(document.joinForm.ph_number.value).length ==0 && chktrim(document.joinForm.mobile_phone.value).length ==0) {
		alert("Enter Your Landline(s)/ Mobiles(s) Number ");
		document.joinForm.ph_number.focus();
		return false;
	}
	if (!parseInt(document.joinForm.ph_number.value) && !parseInt(document.joinForm.mobile_phone.value)) {
		
		alert("Incorrect Landline(s)/ Mobiles(s) Number ");				
		document.joinForm.ph_number.focus();
		return false;
	}	
	
	
	/*if (chktrim(document.joinForm.ph_acode.value).length ==0) {
		alert("Enter Phone Number - Area Code");
		document.joinForm.ph_acode.focus();
		return false;
	}
	if (!parseInt(document.joinForm.ph_acode.value)) {
		alert("Incorrect Phone - Area Code");
		document.joinForm.ph_acode.focus();
		return false;
	}
	
	if (chktrim(document.joinForm.ph_number.value).length ==0) {
		alert("Enter Phone Number");
		document.joinForm.ph_number.focus();
		return false;
	}
	if (!parseInt(document.joinForm.ph_number.value)) {
		alert("Incorrect Phone Number");
		document.joinForm.ph_number.focus();
		return false;
	}*/
		
	if (document.joinForm.bus_ty.options[document.joinForm.bus_ty.selectedIndex].value=="")  {
      	alert("Select your Business Type");
      	document.joinForm.bus_ty.focus();
      	return false;
   	}
}

function validate_message(objfrm) {
	
	if (objfrm.subject.value.length == 0) {
		
		alert("Please Enter Subject");
		objfrm.subject.focus();
		return false;
	}   	
	
	if (objfrm.message.value.length == 0) {		
		alert("Please Enter Message");
		objfrm.message.focus();
		return false;
	}     
	
	if (chktrim(document.joinForm.message.value).length>160) {
		alert("Your Message should be maximum 160 characters");
		document.joinForm.message.focus();
		return false;
	}
}



function trade_chk_login(objfrm) {
	if (chktrim(document.joinForm.detailReq.value).length<=20) {
		alert("Your Message should be minimum 20 characters");
		document.joinForm.detailReq.focus();
		return false;
	}			
	  
	if (objfrm.user_name.value.length == 0) {
      alert("E-mail ID can't be left blank");
      objfrm.user_name.focus();
      return false;
   }
      
   if (objfrm.user_name.value.indexOf('@') == -1) {
      alert("Error in Email ID");
      objfrm.user_name.focus();
      return false;
   }
   if (objfrm.user_name.value.indexOf('.') == -1) {
      alert("Error in Email ID");
      objfrm.user_name.focus();
      return false;
   }
   if (objfrm.user_name.value.indexOf('@') !=  objfrm.user_name.value.lastIndexOf('@')) {
      alert("Please Specify One Email ID only");
      objfrm.user_name.focus();
      return false;
   }
        		
   if (objfrm.pass_word.value.length==0) {
      alert("Enter Your Password ");
      objfrm.pass_word.focus();
      return false; 
   }   
   return true;
}

function SubmitAction() {
	
	document.form1.action = "paidinquiry-new.php?id11=Del"; 		
}

function SubmitActive() {
	document.form1.action = "shift_delete_mem_ei.php?id11=active"; 		
}

function membershipVtrust(num) {
	for(i=1; i<=2; i++) {
		t=document.getElementById('tab'+i);
		tc=document.getElementById('tab'+i+'content');
		if (num==i) {
		  t.className=t.className+' active';
			tc.className='co bgWhite';
		}
		else {
			t.className=t.className.replace(/ active/g, '');
			tc.className='co bgWhite none';
		}
	}
}


function lowerCase_all(formn,fieldname) {
	
	var objfrm = eval('document.'+formn+'.'+fieldname);		
	
	var tmpStr;
	
	tmpStr = objfrm.value.toLowerCase();
	objfrm.value=tmpStr;
	
}

// Below script is used to hide particular element.somesh
function hide(idname) {
	
	document.getElementById(idname).style.display='none';
}

// Below script is used to unhide particular element.somesh
function unhide(idname) {
	
	document.getElementById(idname).style.display='';
}

// Below function is used to hide and unhide element.somesh
function hide_unhide(elementname) {
	
	if(document.getElementById(elementname).style.display == 'none'){
				
		document.getElementById(elementname).style.display = 'block';
	}
	else {
		
		document.getElementById(elementname).style.display = 'none';
	}
}			

function catalogRequest_valid(form1) {
	
	if (chktrim(document.form1.subject.value).length==0) {
		alert("Enter Your Subject");
		document.form1.subject.focus();
		return false;
	}
		
	if (chktrim(document.form1.req_detail.value).length<=20) {
		alert("Your Requirement Details should be minimum 20 characters");
		document.form1.req_detail.focus();
		return false;
	}	
}
	
// Below function is used to restrict member to enter character.It will allow member to enter number only
function isNumberKey(evt) {

	var charCode = (evt.which) ? evt.which : event.keyCode;
	
	if (charCode!=46) {
		
		if (charCode > 31 && (charCode < 48 || charCode > 57)) {
			return false;
		}
		else {
			return true;
		}
	}
}	


function chk_comp_profile() {
	
	if (document.joinForm.designation.value.length==0) {
	   alert("Enter Your Designation at work ");
	   document.joinForm.designation.focus();
	   return false;
	}
	if (document.joinForm.year_estd.value.length==0) {
	   alert("Enter Year of Company Establishment ");
	   document.joinForm.year_estd.focus();
	   return false;
	}
	
	 if (document.joinForm.bus_ceo.value.length==0) {
        alert("Enter Name of CEO/Owner");
        document.joinForm.bus_ceo.focus();
        return false;
     }
     
     if (document.joinForm.noof_emp.options[document.joinForm.noof_emp.selectedIndex].value == "0") {
        alert("Select Number of Employees");
        document.joinForm.noof_emp.focus();
        return false;
     }
     if (document.joinForm.turnover.options[document.joinForm.turnover.selectedIndex].value == "0") {
        alert("Select Turnover of Company ");
        document.joinForm.turnover.focus();
        return false;
     }
     
     if (document.joinForm.company_profile.value.length<20) {
        alert("Your Company Profile should be minimum 20 characters");
        document.joinForm.company_profile.focus();
        return false;
     }
     
     if (document.joinForm.company_profile.value.length>5000) {
        alert("Enter Company Profile (max. 5000 characters)");
        document.joinForm.company_profile.focus();
        return false;
     }
}


function chk_joinguestnow1(chk1) { // validation on join now second page(first half).somesh    
	
    if (chktrim(chk1.your_name.value).length==0) {
        alert("Enter your name");
        chk1.your_name.focus();
        return false;
    }
    
    //To check .net .com etc words in name field
    if(!isValid(chk1.your_name)) {
    	return false;
 	}	

    if (chktrim(chk1.comp_name.value).length==0) {
        alert("Enter your company name");
        chk1.comp_name.focus();
        return false;
    }
    //To check .net .com etc words in company name field
    /*if((chktrim(chk1.comp_name.value).length!=0)&&(!isValid(chk1.comp_name))) {
 		return false;
		}*/

    if (chktrim(chk1.designation.value).length==0) {
        alert("Enter Your Designation at work ");
        chk1.designation.focus();
        return false;
    }
    //To check .net .com etc words in designation field
  	 if((chktrim(chk1.designation.value).length!=0)&&(!isValid(chk1.designation))) {
	  	 return false;
  	 }

     if (chktrim(chk1.street_address.value).length ==0) {
        alert("Enter your Street Address");
        chk1.street_address.focus();
        return false;
     }
    //To check .net .com etc words in address field
    if(!isValid(chk1.street_address)) {
    	return false;
 	}
 	
 	if ((chk1.country.value == "IN") &&  (chk1.state_code.options[chk1.state_code.selectedIndex].value == "x")) {
     
        alert("Select your State");
        chk1.state_code.focus();
        return false;
     }
     if (chktrim(chk1.postal_code.value).length == 0) {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }     
     if (chktrim(chk1.postal_code.value).length < 6 && chk1.country.value == "IN") {
        alert("Enter Postal Code");
        chk1.postal_code.focus();
        return false;
     }
     
     if (chktrim(chk1.ph_number.value).length ==0 && chktrim(chk1.mobile_phone.value).length ==0) {
        alert("Enter Your Landline(s) / Mobiles(s) Number ");
        chk1.ph_number.focus();
        return false;
     }
     if (!parseInt(chk1.ph_number.value) && !parseInt(chk1.mobile_phone.value)) {
	     
        alert("Incorrect Landline(s) / Mobiles(s) Number ");
        
        chk1.ph_number.focus();
        return false;
     }
     
     if (chktrim(chk1.ph_number.value).length>0) {
		
		if (chktrim(chk1.ph_ccode.value).length ==0) {
			alert("Enter Phone Number - Country Code");
			chk1.ph_ccode.focus();
			
			return false;
		}     
		if (!parseInt(chk1.ph_ccode.value)) {
			alert("Incorrect Phone  - Country Code");
			chk1.ph_ccode.focus();
			return false;
		}
	}      


    if (chktrim(chk1.bus_ceo.value).length==0) {
        alert("Enter Name of CEO/Owner");
        chk1.bus_ceo.focus();
        return false;
    }
    if (chktrim(chk1.year_estd.value).length<4) {
        alert("Enter Year of Company Establishment (e.g. YYYY )");
        chk1.year_estd.focus();
        return false;
    }
    if (chk1.noof_emp.options[chk1.noof_emp.selectedIndex].value == "0") {
        alert("Select Number of Employees");
        chk1.noof_emp.focus();
        return false;
    }
    if (chk1.turnover.options[chk1.turnover.selectedIndex].value == "0") {
        alert("Select Turnover of Company ");
        chk1.turnover.focus();
        return false;
    }
    if (chk1.bus_category.options[chk1.bus_category.selectedIndex].value == "x") {
        alert("Select Company Nature of Business ");
        chk1.bus_category.focus();
        return false;
    }
    if (chktrim(chk1.detailReq.value).length>350) {
        alert("Enter Product Detail (max. 350 characters)");
        chk1.detailReq.focus();
        return false;
    }
    
    if ((!chk1.detailReq.value.indexOf('.com')) || (!chk1.detailReq.value.indexOf('.net')) || (!chk1.detailReq.value.indexOf('.www'))) {
        
        alert("Don't specify your site address in Product Details fields");            
        chk1.detailReq.focus();            
        return false;
    }
    
    if (chktrim(chk1.detailReq.value).length < 10) {
        
        alert("Enter Your Product Details");            
        chk1.detailReq.focus();            
        return false;
    }   
}


function chk_validation(chk1) { // validation on join now second page(first half).somesh    
	
	if (chktrim(chk1.your_name.value).length==0) {
		alert("Enter your name");
		chk1.your_name.focus();
		return false;
	}
	
	//To check .net .com etc words in name field
	if(!isValid(chk1.your_name)) {
		return false;
	}	
	
	if (chktrim(chk1.comp_name.value).length==0) {
		alert("Enter your company name");
		chk1.comp_name.focus();
		return false;
	} 
	
	
	if (chktrim(chk1.street_address.value).length ==0) {
		alert("Enter your Street Address");
		chk1.street_address.focus();
		return false;
	}
	//To check .net .com etc words in address field
	if(!isValid(chk1.street_address)) {
		return false;
	}	
	
	if (chktrim(chk1.ph_ccode.value).length ==0) {
		alert("Enter Phone Number - Country Code");
		chk1.ph_ccode.focus();		
		return false;
	}     
	if (!parseInt(chk1.ph_ccode.value)) {
		alert("Incorrect Phone  - Country Code");
		chk1.ph_ccode.focus();
		return false;
	}
	
	if (chktrim(chk1.ph_number.value).length ==0) {
		alert("Enter Your Landline(s) Number");
		chk1.ph_number.focus();
		return false;
	}
  
}


function multiple_openwin (file,Iwidth,Iheight,popup_name) {
	
    var newWin = open(file, popup_name, 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
      
    newWin.focus();
      
}
