function companyTabs() {
	t=arguments.length;
	for(i=1; i<=t; i++) {
		document.getElementById('detailH'+i).className='fl cp golden';
		document.getElementById('detailH'+companyTabs.arguments[0]).className='fl cp white';
		document.getElementById('detailH'+i).style.background='#f8de84';
		document.getElementById('detailH'+companyTabs.arguments[0]).style.background='#803e00';
		
		document.getElementById('detailData'+i).className='golden dn';
		document.getElementById('detailData'+companyTabs.arguments[0]).className='golden';
	}
}

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

  	var win = window.open(''+rUrl+'/email_with_us.htm?sendurl=' + target, 'notice', 'width=600,height=500,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 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 firefoxAlert(pageurl) {
	
	if(navigator.appName=="Microsoft Internet Explorer") {
		
		pageurl.style.behavior='url(#default#homepage)';pageurl.setHomePage('http://www.indianyellowpages.com');
	}
	else {
		alert('To set Indianyellowpages.com as your home page in Firefox, click and drag the button to the "Home" icon in your browser.');
	}
	return false;
}

function preloader()  {
	var i = 0;
	imageObj = new Image();
	images = new Array();
	images[0]="tpl_classifieds.gif";
	images[1]="tpl_trade_leads.gif";
	images[2]="tpl_products_over.gif";
	images[3]="tpl_catalogs.gif";
	images[4]="tpl_advertisement.gif";
	for(i=0; i<=3; i++) {
		imageObj.src=images[i];
	}
} 

/*following function calls to show any type of validation in any form*/
function fun_login(a) {
	document.frm.action=a;
	document.frm.submit();
}
function fun_member_login() {
		if(frmlogin.user_name.value=="") {
			alert("User name is invalid or empty");
			frmlogin.user_name.focus();
			return  false;
		}
		else if(frmlogin.pass_word.value=="") {
			alert("Password is invalid or empty ");
			frmlogin.pass_word.focus();
			return false;
		}
		else {
			frmlogin.submit();
			return true;
		}
}
function Form_Validation(Form_Object) {
	
	/*fetching the total number of elements from form*/
	Total_Elements=(Form_Object.elements.length);
    
	var Email_Check = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	/*running loop to check the elements of form one by one*/
	for(Element_Count=0; Element_Count<Total_Elements; Element_Count++) {
		
		/*storing element object*/
		var Element_Object=Form_Object.elements[Element_Count];
		
		/*storing element name*/
		var Element_Name=Element_Object.name;
		
		/*storing element value*/
		var Element_Value=chktrim(Element_Object.value);
		
		/*storing element type*/
		var Element_Type=Element_Object.type;
		
		/*spliting the element namer*/
		var Array_Split=Element_Name.split("_");		
		
		if(Array_Split[0].indexOf('Req')!=-1){
			if(Element_Type=='select-one'){
				if (Element_Object.options[Element_Object.selectedIndex].value=="")  {
					alert('Please Select ' +Array_Split[2]);
					Element_Object.focus();
					return false;
				}
			}
			else{
				if(Element_Value.length<1){
					alert('Please enter your ' +Array_Split[2]);
					Element_Object.focus();
					return false;
				}
				else if(Element_Name.indexOf('_Email-Id')!=-1){
					if(!Email_Check.test(Element_Value)){
						alert('Please enter valid ' +Array_Split[2]);
						Element_Object.focus();
						return false;
					}
					
					
				}
				else if(Element_Name.indexOf('_Int_')!=-1){
					if(!parseInt(Element_Value)){
						alert('Please enter valid ' +Array_Split[2]);
						Element_Object.focus();
						return false;
					}
				}
				else if(Array_Split[0].indexOf('Prohb')!=-1){
					
					if(Array_Split[0].indexOf('Prohb')!=-1 || Array_Split[0].indexOf('Prohb1')!=-1){
					   	//To check indiamart, Alibaba etc words in email field
					   	if(isProhibited(Element_Object))
					   		return false;
					}
					
					if(Array_Split[0].indexOf('Prohb')!=-1 || Array_Split[0].indexOf('Prohb2')!=-1){
					   	//To check .net .com etc words in company name field
					    if(!isValid(Element_Object))
					   		return false;
					}
					
				}
			}
		}
		else if(Array_Split[0].indexOf('Prohb')!=-1 && Element_Value.length>0){
			if(Element_Name.indexOf('_Int_')!=-1){
				if(!parseInt(Element_Value)){
					alert('Please enter valid ' +Array_Split[2]);
					Element_Object.focus();
					return false;
				}
			}
			else{
				if(Array_Split[0].indexOf('Prohb')!=-1 || Array_Split[0].indexOf('Prohb1')!=-1){
				   	//To check indiamart, Alibaba etc words in email field
				   	if(isProhibited(Element_Object))
				   		return false;
				}
				
				if(Array_Split[0].indexOf('Prohb')!=-1 || Array_Split[0].indexOf('Prohb2')!=-1){
				   	//To check .net .com etc words in company name field
				    if(!isValid(Element_Object))
				   		return false;
				}
			}
		}
	}
}
	
	
	
function Add_Content_In_Selectbox(form_name, addCont, remCont, countriesHidden, submitVal) {
	var selValue;
	var selValueText;
	var countries='';

	addContEval=eval('document.'+form_name+'.'+addCont);
	remContEval=eval('document.'+form_name+'.'+remCont);
	countriesHiddenEval=eval('document.'+form_name+'.'+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'){
		eval('document.'+form_name+'.submit();');
	}
}

function Rem_Content_From_Selectbox(form_name, addCont, remCont, countriesHidden, submitVal) {
	
	var count = 0;
	var countries='';
	var selectedArrayValue = new Array();
	var selectedArrayText = new Array();
	addContEval=eval('document.'+form_name+'.'+addCont);
	remContEval=eval('document.'+form_name+'.'+remCont);
	countriesHiddenEval=eval('document.'+form_name+'.'+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'){
			eval('document.'+form_name+'.submit();');
		}
	}	
}

/*Function  : display_show_format_options(param1,param2,param3) 
  Objective : Writes content(html) to div 
  @param1   : id of div where content is to be write
  @param2   : '' (to be write.........)
  @param3   : text to write
  Output    : Nothing
*/

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);
}//end of display_show_format_options()


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



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  : show_format_options(param1,param2,param3,param4) 
  Objective : To Display product display setting dynamically
  @param1   : id of div where order select box is to be shown
  @param2   : id of div where tree structure select box is to be shown
  @param2   : 'Y' to display order select box  'N' to disable it
  @param4   : '1' to display tree select box for main catg
  			: '2' to display tree select box for sub catg
  			: '3' to display tree select box for final product
  Output    :
  			Displays generated form control in div according to parameter passed 
*/


function show_format_options(divid1,divid2,option1,option2){
	
	if(option1=="Y"){
		var Table='<table border="0" cellpadding="0" ><tr><td  width=157>Choose Format</td>';
		Table=Table+ "<td>:<select name=VFinalProStatus>";
		Table=Table+ "<option value=Default>Default</option><option value='New'>New  with Some Detail</option><option value='New Without Detail'>New  with any Detail</option>";
		Table=Table+ "</select></td></tr></table>";
	
	}
	else{
		var Table='';		
				
    }
    
   
	display_show_format_options(divid1,'',Table);//showing display order
	
	
}//end of show_format_options()

/*Function  :enquiryValid(param1,param2) 
  Objective : To validate enquiry form
  @param1   : 'Y' for existing user , 'N' for Non member (login has to be check or not)
  @param2   : 'N' for existing user , 'Y' for Non member (User information has to be check or not)
  Output    :
  	Submits form    : If all fields are correct
    False           : If any field value is found incorrect */

function enquiryValid(loginChk, formChk) {
	if (document.joinForm.detailReq.value.length<10 || document.joinForm.detailReq.value.length>1000){
    	if (document.joinForm.detailReq.value.length>1000){
    		alert("Your Requirement Details [ maximum 1000 characters ] ");
		}
		else {
    		alert("Please enter your Requirement Details [ minimum 10 characters ] ");
		}
        document.joinForm.detailReq.focus();
        return (false);
	}

	if (loginChk=="Y") {
		pp = chk_login(document.joinForm);
		document.joinForm.id3.value="Send Inquiry";
	}
	else if (formChk=="Y") {
		pp = guestMemValid(document.joinForm);//
		if (pp==false) {		
			return false;
		}
		else {
	   		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>1000) {
		   			alert("Enter Products/Services Detail not exceed 1000 characters");	
	   				document.joinForm.product_desc.focus();
		   			return false;		   			
	   			}
	
	   		}
   		}
		document.joinForm.id4.value="Send Inquiry";		
	}
	else {
		var pp="true";		
	}
	
	if (pp !=false || pp=="true") {		
		document.joinForm.submit();
	}
}//end of enquiryValid

/*Function  : guestMemValid(param) 
  Objective : To validate Join now form
  @param    : Form Object
  Output    :
  	True    : If all fields are correct
    False   : If any field value is found incorrect */

function guestMemValid (objfrm) {
	if (chktrim(objfrm.your_name.value).length==0) {
      	alert("Enter your name");
	  	objfrm.your_name.focus();
      	return false;
   	}
   	//To check .net .com etc words in name field
     
    if(!isValid(objfrm.your_name))
   		return false;
   	
   	if (chktrim(objfrm.username.value).length == 0) {
      	alert("E-mail address can't be left blank");
      	objfrm.username.focus();
      	return false;
   	}
   	if (objfrm.username.value.indexOf('@') == -1) {
      	alert("Error in e-mail address");
      	objfrm.username.focus();
      	return false;
   	}
   	if (objfrm.username.value.indexOf('.') == -1) {
      	alert("Error in e-mail address");
      	objfrm.username.focus();
      	return false;
   	}
   	if (objfrm.username.value.indexOf('@') != objfrm.username.value.lastIndexOf('@')) {
      	alert("Please Specify One E-mail address only");
      	objfrm.username.focus();
      	return false;
   	}   	
   	//To check indiamart, Alibaba etc words in email field
   	if(isProhibited(objfrm.username))
   		return false;
   	
   	//To check .net .com etc words in company name field
    if((objfrm.comp_name.value.length!=0)&&(isProhibited(objfrm.comp_name)))
     	return false;	
   		
   	if (objfrm.country.options[objfrm.country.selectedIndex].value=="")  {
      	alert("Select your Country");
      	objfrm.country.focus();
      	return false;
   	}
   	
   	if (chktrim(objfrm.address.value).length ==0) {
      	alert("Enter Street Address");
      	objfrm.address.focus();
      	return false;
   	}
	
   	//To check .net .com etc words in address field
    if(!isValid(objfrm.address))
   		return false;
   	
   	//To check .net .com etc words in city field
    /*if((objfrm.city.value.length!=0)&&(isProhibited(objfrm.city)))
     	return false;
   
    //To check .net .com etc words in state field
   
    if((objfrm.state.value.length!=0)&&(isProhibited(objfrm.state)))
     	return false;*/
     	 			
	if (objfrm.ph_ccode.value.length ==0) {
        alert("Enter Phone Number - Country Code");
        objfrm.ph_ccode.focus();
        return false;
     }
     if (!parseInt(objfrm.ph_acode.value)) {
        alert("Incorrect Phone - Area Code");
        objfrm.ph_acode.focus();
        return false;
     }
     if (chktrim(objfrm.ph_number.value).length ==0) {
        alert("Enter Phone Number");
        objfrm.ph_number.focus();
        return false;
     }   
} //end of guestMemValid()

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

	var index;
	var tmpStr;
	var tmpChar;
	var preString;
	var postString;
	var strlen;
	var string;
	
	tmpStr = objfrm.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;
		         }
		     }
		}
	}
	
	/*var searchVars=new Array("in","am","are","is","this","that","like","suchas","from","such","as","fine","if","for","and","have","with","the","a","to","of","upto","also","other","or","per","all","amongst","among");	
	var results=tmpStr;
	for (array_index = 0; array_index < searchVars.length; array_index++)  {
		if (tmpStr.toLowerCase().indexOf(searchVars[array_index].toLowerCase())!=-1){
			var replacev=(searchVars[array_index].substring(0,1).toUpperCase() + searchVars[array_index].substring(1,tmpStr.length).toLowerCase();
			results=tmpStr.replace(/ replacev /gi,' in ');
		}
	}*/
	
	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 ');				
	objfrm.value=results;
	
}

function removeCategory(formname,name1,name2) {

    chk1 = eval(formname+'.'+name1);		
    chk1.value='';  
    chk2 = eval(formname+'.'+name2);		
	chk2.value='';
}

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

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 catg_search(chk1) {
   if (chk1.busty.options[chk1.busty.selectedIndex].value == "") {
      alert("Select a Searching 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 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  : getCheck_window(param1,param2) 
  Objective : To validate email id value
  	@param1    : email id 
  	@param2    : Form Object
  Output    :
  	False   : If any field value is found incorrect 
  			 	
*/

function setBodyAndColumn() {
	var screenWidth=screen.width;
	var Body=document.getElementById('body');
	var wideColumn=document.getElementById('wide_column');
	
	if(screenWidth>=1024) {
		Body.style.width='990px';
		wideColumn.style.width=735+'px';
	}
	else {
		Body.style.width='770px';
		wideColumn.style.width=520+'px';
	}
}
function setHomeWelcome() {
	var homeWelcome=document.getElementById('home_welcome');
	if(screen.width>=1024) {
		homeWelcome.style.width=700+'px';
		homeWelcome.style.marginTop=(155-homeWelcome.offsetHeight)/2+5+'px';
	}
	else {
		homeWelcome.style.width=480+'px';
		homeWelcome.style.marginTop=(155-homeWelcome.offsetHeight)/2+5+'px';
	}
	//onload=onresize=setHomeWelcome;
}
/*
onload=onresize=function() {
	setBodyAndColumn();
	setHomeWelcome();
}
*/

function getCheck_window(username,objfrm){
   if (objfrm.username.value.length == 0) {
      alert("E-mail address can't be left blank");
      objfrm.username.focus();
      return false;
   }
   //To check 'india mart,alibaba etc. words
   if(isProhibited(objfrm.username))
   		return false;
   if (objfrm.username.value.indexOf('@') == -1) {
      alert("Error in e-mail address");
      objfrm.username.focus();
      return false;
   }
   if (objfrm.username.value.indexOf('.') == -1) {
      alert("Error in e-mail address");
      objfrm.username.focus();
      return false;
   }
   if (objfrm.username.value.indexOf('@') != objfrm.username.value.lastIndexOf('@')) {
      alert("Please Specify One E-mail address only");
      objfrm.username.focus();
      return false;
   }
	window.open('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 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+"  classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000>  <PARAM NAME='movie' VALUE='"+filename+"?link="+alink+"'>              <PARAM NAME='quality' VALUE='high'> <PARAM NAME='bgcolor' > <embed src='"+filename+"?link="+alink+"' quality='high' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' "+attrb+"/></OBJECT>"; 
		/*
		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+">
	<param name='movie' value='"+filename+"?link="+alink+"'>
	<param name='quality' value='high'>
	<embed src='"+filename+"?link="+alink+"' quality='high' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" "+attrb+"></embed>
	</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 MM_setLiveChatLayer(objName,TxtMatter) { //v4.01

	if ((obj=MM_findObj(objName))!=null) with (obj)

    if (document.layers) {
	    document.write(unescape(TxtMatter)); document.close();
	}
    else { 
	    innerHTML = unescape(TxtMatter);
    }

}


function disable_search_form(joinForm) {
	var flag=false;

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

	document.joinForm.bus_c.disabled=flag;
	return true;
}


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 valid_Email_checked_checkbox(formn){
	formObject=eval('document.'+formn);
	
    var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(formObject.username.value.length<1){
		alert("You cannot leave the email field empty");
		formObject.username.focus();
		return false;
	}
	else if(!regex.test(formObject.username.value)){
		alert("Invalid email address format");
		formObject.username.focus();
		return false;
	}
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
      if (dml.elements[i].checked==true) {
         pp=2;
      }
    }
    if (pp==1) {
      alert("You have not selected any Record.");
      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 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 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 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 chk_form1_trade(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>40) {
	        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 (tlType=="exist" || tlType=="tlpd") {
        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 chk_form1() {
	if (document.form1.tradelead_type.options[document.form1.tradelead_type.selectedIndex].value == "x") {
         alert("Select Trade Lead Type");
         document.form1.tradelead_type.focus();
         return false;
      }
      
      if (document.form1.subject.value.length == 0) {
         alert("Do not leave Subject field blank");
         document.form1.subject.focus();
         return false;
      }
      if (document.form1.keywords.value.length == 0) {
         alert("Do not leave Keyword field blank");
         document.form1.keywords.focus();
         return false;
      }
      if (document.form1.details.value.length>200) {
         alert("Your Details limit upto 200 characters");
         document.form1.details.focus();
         return false;
      }
      if ((!document.form1.details.value.indexOf('.com')) || (!document.form1.details.value.indexOf('.net')) || (!document.form1.details.value.indexOf('.www'))) {
         alert("Don't specify your site address in Details fields");
         document.form1.details.focus();
         return false;
      }
      if (document.form1.details.value.length <= 1) {
         alert("Enter Your Trade Lead Details");
         document.form1.details.focus();
         return false;
      }
  }



function deleteNow(cnt1,cnt2) {
	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 and then proceed");
		return false;
	}  
	if (cnt2==4) {
		p2 = confirm('Are you sure want to Restore');
	}
	if (cnt2<4) {
		p2 = confirm('Are you sure want to delete');
	}
	
	if (!p2) {
		return false;
		}
	}
 

function placement_valid(chk2) {
	for (var i = 0; i < chk2.elements.length; i++) {
		ename = chk2.elements[i].name ;
		if (ename == 'field_type[]') {
			var n = 0;
			for ( opt = 0; opt < chk2.elements[i].options.length; opt++) {
				if (chk2.elements[i].options[opt].selected==true)
				n++;
			}

			if ( n < 1 ) { 
				alert("Select Atleast One Category");
				chk2.elements[i].focus();
				return false; 
				break;
			}

			if ( n > 3 ) {
				alert("You cannot select more than 3 categories");
				chk2.elements[i].focus();
				return false; 
				break;
			}
		}
	}
   	if (chk2.state.options[chk2.state.selectedIndex].value == "x") {
	   alert("Please select one State");
	   chk2.state.focus();
	   return false;
	}

   if ((chk2.state.value=="") && (chk2.resi.checked)) {
      alert("Don't check the Residential State Option");
      chk2.resi.focus(); 
      return false;
   }
}

/*Function  : isProhibited(param) 
  Objective : To check object value is allow or not
  @param    : Object
  Output    :
  	True    : If value is not allowed to enter
  	False   : If value is allowed to enter */
  	
function isProhibited(obj){
	var objval=obj.value;
	invalidstr=new Array("indiamart","india mart", "alibaba","ali baba","tradeindia", "trade-india", "nissi");
	for(i=0;i<invalidstr.length;i++){
		if (chktrim(objval).toLowerCase().indexOf(chktrim(invalidstr[i]).toLowerCase())>=0){	
			alert("Usage of "+invalidstr[i]+" is Prohibited on this site.") 
			obj.focus();
			return true;		
		}
	}
	return false;
}//end of isProhibited()

/*Function isValid(param) 
  Objective: To check object value is allow or not
  @param   :  Object
  Output   :
  	True   : If value is allowed to enter
  	False  : If value is not allowed to enter */
  
function isValid(obj){
	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  : chk_login(param)
  Objective : To validate existing Member Login Form
  @param    : Form Object
  Output    :
  	True    : If all fields are correct
    False   : If any field value is found incorrect */
	
function chk_login(objfrm) {
	   
	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; 
   }
   //To check Indiamart, alibaba etc words in email field
   if(isProhibited(objfrm.user_name)){
   		objfrm.action="../contact-us.htm?msg=err";
   		objfrm.submit;
   		return true;
   }
   return true;
}//end of chk_login()


function feedback_valid() {
  if (document.form1.feedback_detail.value.length<5) {
     alert("Enter your Feedback details");
     document.form1.feedback_detail.focus();
     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 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 chk12() {
      document.joinForm.char_len.value=document.joinForm.req_desc.value.length;
      if (document.joinForm.req_desc.value.length>500) {
         alert("Your Description exceeds 500 characters");
         document.joinForm.req_desc.focus();
         return false;
      }
   }

var pop = '';
function openwin18(nm,newrows,newcolumns) {
   var name=nm;
   if (pop && !pop.closed) {
      pop.close();
   }
   var key1  = ",";
   var newStr = newrows.replace(/ /gi, key1)
   var newStr1 = newcolumns.replace(/ /gi, key1)
   pop=eval("window.open('"+name+"&newrows="+newStr+"&newcolumns="+newStr1+"','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 search_valid(chk2) {
   if (chk2.busty.options[document.search.busty.selectedIndex].value == "0") {
      alert("select a business category");
      chk2.busty.focus();
	  return false;
   }
   if (chk2.term.value.length <=1 ) {
      alert("enter product keyword");
      chk2.term.focus();
	  return false;
   }
}

function search_valid_index(chk2) {
	
   	if ( chktrim(chk2.term.value).length <=1 || ( chktrim(chk2.term.value).length >=1 && chk2.term.value=="Enter Search Keywords")) {
		alert("Enter Product / Services Keyword(s)");
      	chk2.term.focus();
	  	return false;
   	} 
}

function search_valid_header(chk2) {
	if (chk2.term.value.length <=1 ) {
      alert("enter product keyword");
      chk2.term.focus();
	  return false;
   }
   if (chk2.busty.options[document.search.busty.selectedIndex].value == "0") {
      alert("select a business category");
      chk2.busty.focus();
	  return false;
   }
   
}

function openwin(file,Iwidth,Iheight) {
   var newWin1=window.open(file,'iypWin1','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');
}
function openwin1(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'iypWin2','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');
}
function openwin2(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'iypWin3','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes, copyhistory=no,width=650,height=500,screenX=0,screenY=0,left=20,top=20');
}
function openwin3(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'iypWin3','x=0,y=0,toolbar=no, menubar=yes, location=no, directories=no,status=no,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,'iypWin4','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');
}
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 (id1.your_name.value.length==0) {
      alert("Enter your name");
	  id1.your_name.focus();
      return false;
   }
   if (id1.comp_name.value.length==0) {
      alert("Enter your company name");
	  id1.comp_name.focus();
      return false;
   }
   if (id1.address.value.length ==0) {
      alert("Enter your Postal Address");
      id1.address.focus();
      return false;
   }
   if (id1.country.value.length==0)  {
      alert("Enter your Country");
      id1.country.focus();
      return false;
   }
   if (id1.phone.value.length==0)  {
      alert("Enter your Country");
      id1.phone.focus();
      return false;
   }
   if (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 (id1.your_requirement.value.length==0)  {
      alert("Enter Your Requirement");
      id1.your_requirement.focus();
      return false;
   }		
}

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 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	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 validbiz_contents(chk,content_type){
	 if(content_type=="Q") {
	 	if (chk.name.value.length==0) {
			alert("Enter the Name");
			chk.name.focus();
			return false;
	     } 
     }
     if(content_type=="Q" ||  content_type=="G") {
		 if (chk.email.value.length==0) {
			alert("Enter the Email-Id");
			chk.email.focus();
			return false;
     	} 	
   		if (chk.email.value.indexOf('.') == -1) {
      		alert("Error in Email ID");
      		chk.email.focus();
      		return false;
   		}
   		if (chk.email.value.indexOf('@') !=  chk.email.value.lastIndexOf('@')) {
      		alert("Please Specify One Email ID only");
      		chk.email.focus();
      		return false;
   		}  
 	}
 	
 	if(content_type=="Q" ||  content_type=="N") {
 	 	if (chk.content_subject.value.length==0) {
			alert("Enter the Subject");
			chk.content_subject.focus();
			return false;
    	}
	}
	 	
   	if (chk.content_detail.value.length==0) {
		alert("Enter the Detail");
		chk.content_detail.focus();
		return false;
    } 	
}

function chk1_valid(chk,titlestatus){
	 if (chk.product_name.value.length==0) {
		alert("Enter Your Product Name");
		chk.product_name.focus();
		return false;
     } 
	 if (chk.full_desc.value.length==0) {
		alert("Enter Your Product Details");
		chk.full_desc.focus();
		return false;
     } 
     if(titlestatus=="Y"){ 
	 	if (chk.short_desc.value.length>250) {
	 		alert("Your short description exceed 250 characters");
	    	chk.short_desc.focus();
	    	return false;
	 	}
	 	if (chktrim(chk.table1_rows.value).length>0) {
		 	if (!parseInt(chk.table1_rows.value)) {
			 	alert("Invalid Numbers of Rows in your 1st Table");
			 	chk.table1_rows.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table1_cols.value).length==0) {
			 	alert("Please specify the Numbers of coloumn in your 1st Table");
			 	chk.table1_cols.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table1_rows.value)>30) {
			 	alert("Maximum Number of Rows in one Table is 30");
			 	chk.table1_rows.focus();
			 	return false;
		 	}
	 	}
	 	if (chktrim(chk.table1_cols.value).length>0) {
		 	if (!parseInt(chk.table1_cols.value)) {
			 	alert("Invalid Numbers of columns in your 1st Table");
			 	chk.table1_cols.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table1_rows.value).length==0) {
			 	alert("Please specify the Rows of coloumn in your 1st Table");
			 	chk.table1_rows.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table1_cols.value)>8) {
			 	alert("Maximum Number of columns in one Table is 8");
			 	chk.table1_cols.focus();
			 	return false;
		 	}
	 	}
	 	if (chktrim(chk.table2_rows.value).length>0) {
		 	if (!parseInt(chk.table2_rows.value)) {
			 	alert("Invalid Numbers of Rows in your 2nd Table");
			 	chk.table2_rows.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table2_cols.value).length==0) {
			 	alert("Please specify the Numbers of coloumn in your 2nd Table");
			 	chk.table2_cols.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table2_rows.value)>30) {
			 	alert("Maximum Number of Rows in one Table is 30");
			 	chk.table2_rows.focus();
			 	return false;
		 	}
	 	}
	 	if (chktrim(chk.table2_cols.value).length>0) {
		 	if (!parseInt(chk.table2_cols.value)) {
			 	alert("Invalid Numbers of columns in your 2nd Table");
			 	chk.table2_cols.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table2_rows.value).length==0) {
			 	alert("Please specify the Rows of coloumn in your 2nd Table");
			 	chk.table2_rows.focus();
			 	return false;
		 	}
		 	if (chktrim(chk.table2_cols.value)>8) {
			 	alert("Maximum Number of columns in one Table is 8");
			 	chk.table2_cols.focus();
			 	return false;
		 	}
	 	}
	}
 	if(titlestatus=="nofinaltitle"){ 
		if ((!chk.final_title[0].checked) && (!chk.final_title[1].checked) && (!chk.final_title[2].checked)) {
   			alert("The Description above is about ");
   			return false;
		}
	}	  	         	  
}


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.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.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;
		    }
	    }
}

function chk42(chk) {
   chk.char_len.value=chk.short_desc.value.length;   
      if (chk.short_desc.value.length>250) {
        alert("Your Description exceeds 250 characters");
        chk.short_desc.focus();
        return false;
  	  }
}

function chk4() {
  if ((document.search2.comp_name.value.length==0) && (document.search2.phone.value.length==0) && (document.search2.email_id.value.length==0)) {
     alert("Enter Company Name / Phone No. / Email ID");
     document.search2.comp_name.focus();
     return false;
  }
}
   	  

function chk1() {	
	
     if (chktrim(document.form1.npassword.value).length <6) {
        alert("New Password must be 6 characters ");
        document.form1.npassword.focus();
        return false; 
     }
     if (chktrim(document.form1.cpassword.value).length <6) {
        alert("Confirm New Password must be 6 characters ");
        document.form1.cpassword.focus();
        return false; 
     }
     if (document.form1.cpassword.value != document.form1.npassword.value) { 
        alert("Your new password and confirm new password dosn't match");
        document.form1.npassword.focus();
        return false; 
     }
   }

/*Function  : chk_joinnow(param1,param2,param3)
  Objective : To validate existing New User Registration Login Form
  @param1   : Form Object
  @param2   : 'Y' for existing user , 'N' for Non member (login has to be check or not)
  @param3   : 'add_tp_listing' for checking trade listing else ' '
  Output    :
  	True    : If all fields are correct
    False   : If any field value is found incorrect */
   
   
function chk_joinnow(objfrm,check_login,add_tp_listing) {
	
    if(add_tp_listing!="add_tp_listing"){
		if (objfrm.req_tit.value.length<=1) {
	        alert("Please enter your Requirement keyword");
	        objfrm.req_tit.focus();
	        return false;
	    }
	    if (objfrm.req_desc.value.length>500){
	        alert("Enter Requirement Detail (max. 500 characters)");
	        objfrm.req_desc.focus();
	        return false;
	    }
	    if ((!objfrm.req_desc.value.indexOf('.com')) || (!objfrm.req_desc.value.indexOf('.net')) || (!objfrm.req_desc.value.indexOf('.www'))) {
	        alert("Don't specify your site address in Requirement Details");
	        objfrm.req_desc.focus();
	        return false;
	    }
	    if (objfrm.req_desc.value.length <= 1) {
	        alert("Enter Your Requirement Details");
	        objfrm.req_desc.focus();
	        return false;
	    }
    }
    if(add_tp_listing=="add_tp_listing"){
		if (objfrm.tradelead_type.options[objfrm.tradelead_type.selectedIndex].value == "x") {
			 alert("Select Trade Lead Type");
			 objfrm.tradelead_type.focus();
			 return false;
		}
		if (objfrm.quantity.value.length == 0) {
			 alert("Do not leave Quantity field blank");
			 objfrm.quantity.focus();
			 return false;
		}
		if (objfrm.subject.value.length == 0) {
			 alert("Do not leave Subject field blank");
			 objfrm.subject.focus();
			 return false;
		}
		if (objfrm.keywords.value.length == 0) {
			 alert("Do not leave Keyword field blank");
			 objfrm.keywords.focus();
			 return false;
		}
		if (objfrm.details.value.length>200) {
			 alert("Your Details limit upto 200 characters");
			 objfrm.details.focus();
			 return false;
		}
		if ((!objfrm.details.value.indexOf('.com')) || (!objfrm.details.value.indexOf('.net')) || (!objfrm.details.value.indexOf('.www'))) {
			 alert("Don't specify your site address in Details fields");
			 objfrm.details.focus();
			 return false;
		}
		if (objfrm.details.value.length <= 1) {
			 alert("Enter Your Trade Lead Details");
			 objfrm.details.focus();
			 return false;
		}
    }
	
	
   if(check_login!="true" && check_login!="already_member"){
	    
	   	if(objfrm.username.value.length == 0) {
	      alert("E-mail address can't be left blank");
	      objfrm.username.focus();
	      return false;
	   	}
	   	if (objfrm.username.value.indexOf('@') == -1) {
	      alert("Error in e-mail address");
	      objfrm.username.focus();
	      return false;
	    }
	    if (objfrm.username.value.indexOf('.') == -1) {
	      alert("Error in e-mail address");
	      objfrm.username.focus();
	      return false;
	    }
	   	if (objfrm.username.value.indexOf('@') != objfrm.username.value.lastIndexOf('@')) {
	      alert("Please Specify One E-mail address only");
	      objfrm.username.focus();
	      return false;
	   	}

	   	//To check indiamart, Alibaba etc words in email field
   		if(isProhibited(objfrm.username))
   		 	return false;
   	   			
	    if (chktrim(objfrm.cpassword.value).length <6) {
	        alert("Password must be 6 characters ");
	        objfrm.cpassword.focus();
	        return false;
	    }
	    if (chktrim(objfrm.confirmpassword.value).length <6) {
	        alert("Re-enter Password must be 6 characters ");
	        objfrm.confirmpassword.focus();
	        return false;
	    }
	    if (objfrm.cpassword.value != objfrm.confirmpassword.value) {
	        alert("Your Password and Re-enter password dosn't match");
	        objfrm.cpassword.focus();
	        return false;
	    }
	       
	    if (chktrim(objfrm.your_name.value).length==0) {
	        alert("Enter your name");
	        objfrm.your_name.focus();
	        return false;
	    }
	     
	    //To check .net .com etc words in name field
    	if(!isValid(objfrm.your_name))
     		return false;
	    
	   	//To check .net .com etc words in company name field
    	if((objfrm.comp_name.value.length!=0)&&(isProhibited(objfrm.comp_name)))
     		return false;
     
    	//To check .net .com etc words in designation field
      	 if((objfrm.designation.value.length!=0)&&(!isValid(objfrm.designation)))
     		return false;
     	     		
     	 if (objfrm.country.options[objfrm.country.selectedIndex].value == "x") {
	      alert("Select Country Name ");
	      objfrm.country.focus();
	      return false;
	     }
	     
	     if (chktrim(objfrm.street_address.value).length ==0) {
	        alert("Enter your Street Address");
	        objfrm.street_address.focus();
	        return false;
	     }
	     
	     //To check .net .com etc words in address field
    	 if(!isValid(objfrm.street_address))
     		return false;
     	     		
     	 //To check .net .com etc words in city field
      	 if((objfrm.city.value.length!=0)&&(!isValid(objfrm.city)))
     		return false;
     				
	     if ((objfrm.country.value == "IN") &&  (objfrm.state.options[objfrm.state.selectedIndex].value == "x")) {
	        alert("Select your State");
	        objfrm.state.focus();
	        return false;
	     }
	     if (objfrm.country.value == "IN" && objfrm.postal_code.value.length<6) {
	        alert("Enter Zip/Postal Code ");
	        objfrm.postal_code.focus();
	        return false;
	     }
	     if (!parseInt(objfrm.ph_ccode.value)) {
	        alert("Incorrect Phone  - Country Code");
	        objfrm.ph_ccode.focus();
	        return false;
	     }
	     if (objfrm.ph_acode.value.length ==0) {
	        alert("Enter Phone Number - Area Code");
	        objfrm.ph_acode.focus();
	        return false;
	     }
	     if (!parseInt(objfrm.ph_acode.value)) {
	        alert("Incorrect Phone - Area Code");
	        objfrm.ph_acode.focus();
	        return false;
	     }
	     if (objfrm.ph_ccode.value.length ==0) {
	        alert("Enter Phone Number - Country Code");
	        objfrm.ph_ccode.focus();
	        return false;
	     }
	     if (objfrm.ph_number.value.length ==0) {
	        alert("Enter Phone Number");
	        objfrm.ph_number.focus();
	        return false;
	     }
	     if (!parseInt(objfrm.ph_number.value)) {
	        alert("Incorrect Phone Number");
	        objfrm.ph_number.focus();
	        return false;
	     }
	     
	     //To check Indiamart, alibaba etc words in alternate_email field
      	 if(isProhibited(objfrm.alternate_email))
   			return false;	        
	}
}//end of chk_joinnow



function validChgInfo(dml) {
	if (dml.your_name.value.length ==0) {
		alert("Please Enter Your Name");
		dml.your_name.focus();
		return false;
	}
	if (dml.comp_name.value.length ==0) {
		alert("Please Enter Company Name");
		dml.comp_name.focus();
		return false;
	}
	if (dml.username.value.length ==0) {
		alert("Please Enter Email Address");
		dml.username.focus();
		return false;
	}
	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 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 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 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')      
	}
	if (dml.table1_title.value.length ==0) {
        alert("Please Enter title for Ist Table");
        dml.table1_title.focus();
        return false;
     }
	if (dml.table2_title.value.length ==0) {
        alert("Please Enter title for IInd Table");
        dml.table2_title.focus();
        return false;
     }
}

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

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

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

}

function chk_joinnow_1step(chk1, pchk) { // validation on join now first page.brijesh
	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.country.options[chk1.country.selectedIndex].value == "x") {
	  	alert("Select Country Name ");
	    chk1.country.focus();
	    return false;
	}
	if (pchk=="Y") {	
		if (chk1.bus_c.options[chk1.bus_c.selectedIndex].value == "x") {
			alert("Select Nature of Business ");
	        chk1.bus_c.focus();
	        return false;
		}
	}
}

function chk_joinnow_new() { // validation on join now first page.brijesh
   
     if (chktrim(document.joinForm.your_name.value).length==0) {
        alert("Enter your name");
        document.joinForm.your_name.focus();
        return false;
     }
    
     //To check .net .com etc words in name field
     
     if(!isValid(document.joinForm.your_name))
   		return false;
   		
   		 if (document.joinForm.comp_name.value.length==0) {
        alert("Enter your company name");
        document.joinForm.comp_name.focus();
        return false;
     }
     
     //To check .net .com etc words in company name field
     
     if(!isValid(document.joinForm.comp_name))
   		return false;
   		
     if (document.joinForm.designation.value.length==0) {
        alert("Enter Your Designation at work ");
        document.joinForm.designation.focus();
        return false;
     }
     
     //To check .net .com etc words in designation field
     
     if(!isValid(document.joinForm.designation))
   		return false; 		
    
           		
   	if (chktrim(document.joinForm.street_address.value).length ==0) {
        alert("Enter your Street Address");
        document.joinForm.street_address.focus();
        return false;
     }
     
     //To check .net .com etc words in address field
     
     if(!isValid(document.joinForm.street_address))
   		return false;
   		
     if ((document.joinForm.country.value == "IN") &&  (document.joinForm.state.options[document.joinForm.state.selectedIndex].value == "x")) {
        alert("Select your State");
        document.joinForm.state.focus();
        return false;
     }
     
     if (document.joinForm.country.value == "IN" && document.joinForm.postal_code.value.length<6) {
        alert("Enter Zip/Postal Code ");
        document.joinForm.postal_code.focus();
        return false;
     }
     //To check .net .com etc words in city field
      		
     if((document.joinForm.city.value.length!=0)&&(!isValid(document.joinForm.city)))
     	return false;
          
     //To check .net .com etc words in state field
     if ((document.joinForm.country.value != "IN")&&(document.joinForm.state.value.length!=0)&&(!isValid(document.joinForm.state)))
     	return false;	
     	
     if (!parseInt(document.joinForm.ph_ccode.value)) {
        alert("Incorrect Phone  - Country Code");
        document.joinForm.ph_ccode.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 (!parseInt(document.joinForm.ph_acode.value)) {
        alert("Incorrect Phone - 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.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.member_type.value!=0) {    
    
   		
     if (document.joinForm.bus_ceo.value.length==0) {
        alert("Enter Name of CEO/Owner");
        document.joinForm.bus_ceo.focus();
        return false;
     }
     
     //To check .net .com etc words in ceo name  field
     
     if(!isValid(document.joinForm.bus_ceo))
   		return false;
   		
     if (document.joinForm.year_estd.value.length<4) {
        alert("Enter Year of Company Establishment (e.g. YYYY )");
        document.joinForm.year_estd.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.bus_category.options[document.joinForm.bus_category.selectedIndex].value == "x") {
        alert("Select Company Nature of Business ");
        document.joinForm.bus_category.focus();
        return false;
     }
     if (document.joinForm.product_desc.value.length<20) {
        alert("Your Product Detail should be minimum 20 characters");
        document.joinForm.product_desc.focus();
        return false;
     }
     if (document.joinForm.product_desc.value.length>350) {
        alert("Enter Product Detail (max. 350 characters)");
        document.joinForm.product_desc.focus();
        return false;
     }
     if ((!document.joinForm.product_desc.value.indexOf('.com')) || (!document.joinForm.product_desc.value.indexOf('.net')) || (!document.joinForm.product_desc.value.indexOf('.www'))) {
        alert("Don't specify your site address in Product Details fields");
        document.joinForm.product_desc.focus();
        return false;
     }
     
     if (document.joinForm.product_desc.value.length <= 1) {
        alert("Enter Your Product Details");
        document.joinForm.product_desc.focus();
        return false;
     }
     if ((document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 1) || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 2) || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 3) || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 4) || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 6) || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == 7)) {
     }
     
     if ((document.joinForm.country_deal.value.length==0) && ((document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == "1") || (document.joinForm.bus_category.options[document.joinForm.bus_category.selectedIndex].value == "2"))) {
        alert("Select Country dealing with ");
        document.joinForm.country_deal.focus();
        return false;
     }
 }
 
 if (document.joinForm.id.value!="new_catg" && document.joinForm.id.value!="paid_member") {
	 
	if (chktrim(document.joinForm.cpassword.value).length <6) {
		
	    alert("Password must be 6 characters ");
	    document.joinForm.cpassword.focus();
	    return false;
	 }
     if (chktrim(document.joinForm.confirmpassword.value).length <6) {
	     
        alert("Re-enter Password must be 6 characters ");
        document.joinForm.confirmpassword.focus();
        return false;
     }
         
     if (document.joinForm.cpassword.value != document.joinForm.confirmpassword.value) {
	     
        alert("Your Password and Re-enter password dosn't match");
        document.joinForm.cpassword.focus();
        return false;
  	 }
  	 
  	 var validate_password =/^([a-zA-Z0-9])+$/;
	    	
	 if ((!validate_password.test(document.joinForm.cpassword.value)) && chktrim(document.joinForm.cpassword.value).length >5) {
		 
        alert("Please do not use Special Character in Password");
        document.joinForm.cpassword.focus();
        return false;
	 }
}
 
  /*if(document.joinForm.member_type.value!=0 && document.joinForm.member_type.value!=1 && document.joinForm.member_type.value!=10022) {
	  if ((!document.joinForm.pymt_mode[0].checked) && (!document.joinForm.pymt_mode[1].checked) && (!document.joinForm.pymt_mode[2].checked) && (!document.joinForm.pymt_mode[3].checked) && (!document.joinForm.pymt_mode[4].checked) && (!document.joinForm.pymt_mode[5].checked) && (!document.joinForm.pymt_mode[6].checked) && (!document.joinForm.pymt_mode[7].checked) && (!document.joinForm.pymt_mode[8].checked) && (!document.joinForm.pymt_mode[9].checked) && (!document.joinForm.pymt_mode[10].checked)) {
           alert("Please check Your Mode Of Payment");
           document.joinForm.pymt_mode[0].focus();
           return false;
        }
      
     }*/
     
     
     
     
     //To check Indiamart, alibaba etc words in alternate_email field
     
     if(isProhibited(document.joinForm.alternate_email))
   		return false;
     		 
     if(!document.joinForm.iagree.checked) {
        alert("You must check the Terms and Conditions");
        document.joinForm.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 Description exceeds 350 characters");
		document.joinForm.product_desc.focus();
		return false;
	}
}

// it is userd for images on header-html
if (document.images)
{
  topHome= new Image; 
  topHome.src="/images_1/topHome.gif"; 
  topHomeOver= new Image; 
  topHomeOver.src="/images_1/topHomeOver.gif"; 

  topContact= new Image; 
  topContact.src="/images_1/topContact.gif"; 
  topContactOver= new Image; 
  topContactOver.src="/images_1/topContactOver.gif"; 

  topLogin= new Image; 
  topLogin.src="/images_1/topLogin.gif"; 
  topLoginOver= new Image; 
  topLoginOver.src="/images_1/topLoginOver.gif"; 

  topJoin= new Image; 
  topJoin.src="/images_1/topJoin.gif";
  topJoinOver= new Image; 
  topJoinOver.src="/images_1/topJoinOver.gif"; 
  
  topEnquiry= new Image; 
  topEnquiry.src="/images_1/topEnquiry.gif"; 
  topEnquiryOver= new Image; 
  topEnquiryOver.src="/images_1/topEnquiryOver.gif"; 
  
  topHelp= new Image; 
  topHelp.src="/images_1/topHelp.gif"; 
  topHelpOver= new Image; 
  topHelpOver.src="/images_1/topHelpOver.gif"; 
  
  topMyFolder= new Image; 
  topMyFolder.src="/images_1/topMyFolder.gif"; 
  topMyFolderOver= new Image; 
  topMyFolderOver.src="/images_1/topMyFolderOver.gif"; 
  
  topLogout= new Image; 
  topLogout.src="/images_1/topLogout.gif"; 
  topLogoutOver= new Image; 
  topLogoutOver.src="/images_1/topLogoutOver.gif";   
  
  
  topProLin01= new Image; 
  topProLin01.src="/images_1/topProLin01.gif"; 
  topProLin01Over= new Image; 
  topProLin01Over.src="/images_1/topProLin01Over.gif"; 
  
  topProLin02= new Image; 
  topProLin02.src="/images_1/topProLin02.gif"; 
  topProLin02Over= new Image; 
  topProLin02Over.src="/images_1/topProLin02Over.gif"; 
  
  topProLin03= new Image; 
  topProLin03.src="/images_1/topProLin03.gif"; 
  topProLin03Over= new Image; 
  topProLin03Over.src="/images_1/topProLin03Over.gif"; 
  
  topProLin04= new Image; 
  topProLin04.src="/images_1/topProLin04.gif"; 
  topProLin04Over= new Image; 
  topProLin04Over.src="/images_1/topProLin04Over.gif"; 
}


function mOver(picName)
{
	if (document.images)
	{
		picOver=eval(picName + "Over.src");
		document[picName].src=picOver;
	}
}


function mOut(picName)
{
	if (document.images)
	{
		picOver=eval(picName + ".src");
		document[picName].src=picOver;
	}
}
function chk1() {
	if (document.search.busty.options[document.search.busty.selectedIndex].value == "0") {
		alert("select a business category");
		document.search.busty.focus();
		return false;
	}
	if (document.search.term.value.length <=1 ) {
		alert("enter product keyword");
		document.search.term.focus();
		return false;
	}
}

function chk5() {
	if (document.form10.term.value.length==0) {
		alert("Enter Your Product Keyword");
		document.form10.term.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 addto_basket() {
	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.Please select the parties and then proceed");
	}
	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 ((document.form1.elements[i].type =="checkbox") && (dml.elements[i].checked==true)) {
			pp=2;
		}
	}
	if (pp==1) {
		alert("You have not selected any party.Please select the parties and then proceed");
	}
	else {
		document.form1.id.value="Send Inquiry Now";
		document.form1.target="";
		document.form1.submit();
	}
}

function addto_basket_agricul() {
	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.Please select the parties and then proceed");
	}
	else {		
		document.form1.submit();
	}
}


function agriculture_inquire_now() {
	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.Please select the parties and then proceed");
	}
	else {		
		document.form1.submit();
	}
}

function formLogin() {
	var Email_Check =/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (chktrim(document.form2.user_name.value).length == 0) {
		alert("E-mail ID can't be left blank");
		document.form2.user_name.focus();
		return false;
	}
	else if(!Email_Check.test(chktrim(document.form2.user_name.value))){
		alert('Please enter valid Email-Id');
		document.form2.user_name.focus();
		return false;
	}
	else if (chktrim(document.form2.pass_word.value).length == 0) {
		alert("Password can't be left blank");
		document.form2.pass_word.focus();
		return false;
	}
	else {
		document.form2.id.value='';
		document.form2.id2.value='login';
	}
}

// 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');
}


////////////////////////////////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 Check_Availability(str) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="join-now.php";
	url=url+"?id1=check_emailid&q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged1;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
// End

function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		//alert("res: "+xmlHttp.responseText);
		if(xmlHttp.responseText.length>0) {
			document.getElementById("txtHint1").innerHTML=xmlHttp.responseText;
			var error = document.getElementById("txtHint1").innerHTML;		
			if (error=='incorrect Email ID' ||  error=='Usename already exist.') {
				document.joinForm.username.focus();
				document.getElementById('txtHint1').style.display = 'block'; 
				return false;
			}
		}
		else {
			document.getElementById("txtHint1").innerHTML="";
			document.getElementById('txtHint1').style.display = 'none'; 
		}
	}	
}



/* to view the existing user form or non-existing user form in category section like (agriculture)*/
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 show_url(var1, site_ty) {
	if (site_ty=="live") {
  		popupWin = window.open('http://www.indianyellowpages.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.13/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.10.103/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 check_frm(chk) {
	var checked = 0;
	
	for(i=0;i<chk.elements.length;i++) {
		
		if(chk.elements[i].checked == true)
    	{
         	checked = 1;
		}
		
	}
	if(checked == 0) {
		alert("Please Select atleast one checkbox and than proceed");
	    return false;
	}
}

function chk1_contactus() {
	if (document.joinForm.comp_name.value.length==0) {
      alert("Enter Your Company Name");
      document.joinForm.comp_name.focus();
      return false;
   }
   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.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.Phone.value.length==0) {
      alert("Enter Your Phone Number");
      document.joinForm.Phone.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.comments.value.length<10) {
      alert("Enter Your Comments");
      document.joinForm.comments.focus();
      return false;
   }
}

function toggleDiv( element ) {		
	//var e = $(element);    
	var e = document.getElementById(element);
	
	if(element=="div_activity_log") {
		document.getElementById('div_activity_log').style.display = 'block'; 
		document.getElementById('div_activity_log1').style.display = 'block'; 
		document.getElementById('div_dropdowns').style.display = 'none';			
		document.getElementById('div_dropdowns1').style.display = 'none'; 
	}
	else if(element=="div_dropdowns") {
		document.getElementById('div_dropdowns').style.display = 'block'; 
		document.getElementById('div_dropdowns1').style.display = 'block'; 
		document.getElementById('div_activity_log').style.display = 'none';	
		document.getElementById('div_activity_log1').style.display = 'none'; 
	}
	else {
		document.getElementById('div_activity_log').style.display = 'block'; 
		document.getElementById('div_activity_log1').style.display = 'block'; 
		document.getElementById('div_dropdowns').style.display = 'none';			
		document.getElementById('div_dropdowns1').style.display = 'none';  		
	}

	//alert(e);
    //if (e) {	
      //  e.style.display = ((e.style.display != 'block') ? 'block' : 'none');        
    //}
}

// New Function for newly created advanced search.brijesh
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; 
		}
	}*/
	
	if (chk1.search_base[0].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 to check validation on member requirement(post-requirement.php) page 
function post_requirement_det(chk1,val) { 	
	
	if (chk1.req_desc.value.length==0) {
     	alert("Enter Your Requirement Details (Maximum 1000 characters)");
     	chk1.req_desc.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;
 		}
 		
 		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.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.address.value.length==0) {
        	alert("Enter Your Address ");
         	chk1.address.focus();
         	return false;
      	}
      	//To check .net .com etc words in name field
    	if (!isValid(chk1.address)) {
    		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;
      	}
      	document.joinForm.id.value="submit_member";		    
	}
	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; 
		}				
		document.joinForm.id.value="login";				
	}
}

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

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


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


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

function preloadImages() { //preloadImage function starts
	if(document.images) {
		src=preloadImages.arguments;
		for(i=0; i<src.length; i++) {
			var img='pic'+i;
			img=new Image();
			img.src='images_iyp/'+src[i]+'_over.gif';
		}
	}
} // preloadImages function ends

function over(img) {
	a=img.src.replace('.gif', '_over.gif');
	img.src=a;
}
function out(img) {
	a=img.src.replace('_over.gif', '.gif');
	img.src=a;
}

function countCharacter(PId,ShowId,maxchar) {
	
	var char=document.getElementById(PId).value;
	var showdata=document.getElementById(PId).value;
	var charleng=char.length;
	
	if (charleng > maxchar) {

		document.getElementById(PId).value = document.getElementById(PId).value.substring(0, maxchar);
	
	}
	
	if(maxchar-charleng>=0) {
	
	document.getElementById(ShowId).value=maxchar-charleng;

	}
	else{

	document.getElementById(ShowId).value=0;

	}
}
