    	expires = new Date();
	expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);

function get()
{
if( (cookie = getCookie("newImeshID")) > "")
{
	Values = cookie.split("|");
	if (Values.length >= 7)
	{
		if (document.register_form.company.value.length == 0) document.register_form.company.value = Values[0];
		if (document.register_form.fullname.value.length == 0) document.register_form.fullname.value = Values[1];
		if (document.register_form.job_title.value.length == 0) document.register_form.job_title.value = Values[2];
		if (document.register_form.address.value.length == 0) document.register_form.address.value=Values[3];
		if (document.register_form.city.value.length == 0)  document.register_form.city.value=Values[4];
		if (document.register_form.state.value.length == 0)  document.register_form.state.value=Values[5];
		if (document.register_form.zip.value.length == 0)   document.register_form.zip.value=Values[6];
		if (document.register_form.country.value.length == 0) document.register_form.country.value=Values[7];
		if (document.register_form.email.value.length == 0)    document.register_form.email.value = Values[8];
		if (document.register_form.phoneno.value.length == 0)    document.register_form.phoneno.value=Values[9];
		if (document.register_form.faxno.value.length == 0)    document.register_form.faxno.value=Values[10];
	}
}
return true;
}

function getCookie(Name) {
          var search = Name + "="

          if (document.cookie.length > 0) { // if there are any cookies
					offset = document.cookie.indexOf(search)

                    if (offset != -1) { // if cookie exists
                              offset += search.length
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset)
                              // set index of end of cookie value
                              if (end == -1) end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    }
          }
return "";
}

function tcon()
{
	var code = document.register_form.country.value;
	var s_country_value;
	if(code != 'Select your country')
	{
		array = code.split("|||");
		var temp_string = array[1];
		document.register_form.pc_code.value = temp_string;
		
	}
	else
	{
		document.register_form.pc_code.value = "";
		
	}
}
function disablereadonlyform()
{
	var mailchk=document.register_form.email.value;
	var mailcomp=document.register_form.company.value;
	var mailjob=document.register_form.job_title.value;
	var mailaddress=document.register_form.address.value;
	var mailcity=document.register_form.city.value;
	var mailstate=document.register_form.state.value;
	var mailzip=document.register_form.zip.value;
	var mailcountry=document.register_form.country.value;
	var mailphoneno=document.register_form.phoneno.value;
	var mailfaxno=document.register_form.faxno.value;
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();

	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	var url1="/includes/updatedata.php";
	url1=url1+"?t=" + Math.random()+"&emailchk="+mailchk+"&mailcomp="+mailcomp+"&mailjob="+mailjob+"&mailaddress="+mailaddress+"&mailcity="+mailcity+"&mailstate="+mailstate+"&mailzip="+mailzip+"&mailcountry="+mailcountry+"&mailphoneno="+mailphoneno+"&mailfaxno="+mailfaxno;
	
	// Create a function that will receive data sent from the server
	
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4 && ajaxRequest.status==200){
			if(ajaxRequest.responseText == 1)
			{
				alert('Data Updated Successfully');
				
			}
			else
			{
				alert('Some Problems In Data Updation');
			}

		}
	}

	ajaxRequest.open('GET', url1, true);
	ajaxRequest.send(null);

}
function disablereadonly()
{
	var disablereadonly_form=document.register_form;
	if(document.getElementById("edit").value == "EDIT")
	{
		document.getElementById("company").readOnly=false;
		document.getElementById("job_title").readOnly=false;
		document.getElementById("address").readOnly=false;
		document.getElementById("city").readOnly=false;
		document.getElementById("state").readOnly=false;
		document.getElementById("zip").readOnly=false;
		document.getElementById("country").readOnly=false;
		document.getElementById("edit").value = "UPDATE";
	}
	else if(document.getElementById("edit").value == "UPDATE")
	{
		document.getElementById("company").readOnly=true;
		document.getElementById("fullname").readOnly=true;
		document.getElementById("job_title").readOnly=true;
		document.getElementById("address").readOnly=true;
		document.getElementById("city").readOnly=true;
		document.getElementById("state").readOnly=true;
		document.getElementById("zip").readOnly=true;
		document.getElementById("country").readOnly=true;
		document.getElementById("phoneno").readOnly=true;
		document.getElementById("faxno").readOnly=true;
		document.getElementById("edit").value = "EDIT";
		disablereadonlyform();
	}
}
function check_alternate(emailid)
{
	var mail_alter=document.dee_alternate;
	if(mail_alter.altemail1.value==''||!(/^\w+([-_\.]?\w+)*@\w+([-_\.]?\w+)*(\.\w{2,4})+$/.test(mail_alter.altemail1.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct E-mail ID.");
		mail_alter.altemail1.focus();
		return(false);
	}
	if(mail_alter.altemail1.value==emailid)
	{
		alert("This Email ID already exists. Kindly provide some other alternate E-mail ID.");
		mail_alter.altemail1.focus();
		return(false);
	}
// 	else
// 	{
// 		var val=dee.dee_email.value;
// 		xmlHttp=GetXmlHttpObject()
// 		if(xmlHttp==null)
// 		{
// 		alert ("Some Problem in Data Upadation")
// 		return
// 		}
// 		var url1="/includes/getEmail.php"
// 		url1=url1+"?cat="+val+"&emaildee="+email1;
// 		xmlHttp.onreadystatechange=stateChanged1
// 		xmlHttp.open("GET",url1,true)
// 		xmlHttp.send(null)
// 	}
}
function stateChanged1()
{
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(xmlHttp.responseText==-1)
{
alert('Some Problem in Data Upadation');
return false;
}
}
}
function check_subscriber(thisform){
var s=document.subscriber_form;
myOption=-1;
myOption1=-1;
calculateamount();
for(i=thisform.country_wise.length-1; i>-1; i--){
if(thisform.country_wise[i].checked){
myOption=i; i=-1;
}
}
if(myOption==-1){
alert("You must select a plan.");
return false;
}
for(j=thisform.month_wise.length-1; j>-1; j--){
if(thisform.month_wise[j].checked){
myOption1=j; j=-1;
}
}
if(myOption1==-1){
alert("You must select a monthly/yearly plan.");
return false;
}
if(s.SubCon.options.length==0)
{
alert("You must select a Country.");
return false;
}
if(s.SubCat.options.length==0)
{
alert("You must select a Category.");
return false;
}
if(s.amount.value=='')
{
alert("You must have amount.Please click on the Calculate Amount:");
return false;
}
var CountryList="";
var CatList="";
var prefered_catlist="";
var prefered_countrylist="";
for(i=s.SubCon.options.length-1;i>=0;i--){
if(i==s.SubCon.options.length-1)
{
CountryList+=s.SubCon[i].value;
prefered_countrylist+=s.SubCon[i].value;
}
else
{
CountryList+="# "+s.SubCon[i].value;
prefered_countrylist+="#"+s.SubCon[i].value;
}
}
if(s.SubCon.options.length==238)
{
CountryList="All Countries";
}
s.conreq.value=CountryList;
for(i=s.SubCat.options.length-1;i>=0;i--){
if(i==s.SubCat.options.length-1)
{
CatList+=s.SubCat[i].value;
prefered_catlist+=s.SubCat[i].value;
}
else
{
CatList+="# "+s.SubCat[i].value;
prefered_catlist+="#"+s.SubCat[i].value;
}
}
s.catreq.value=CatList;
s.prefered_categories.value=prefered_catlist;
s.prefered_country.value=prefered_countrylist;
}


function check_register_emailcheck()
{
	var emchk = document.getElementById("epwddisp");
	var s1=document.register_form_emailcheck;
	if(s1.emailcheck1.value==''||!(/^\w+([-_\.]?\w+)*@\w+([-_\.]?\w+)*(\.\w{2,4})+$/.test(s1.emailcheck1.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct E-mail ID.");
		s1.emailcheck1.focus();
		return(false);
	}
	else
	{
// 		emchk.style.display='none';
// 		emchk.style.visibility = 'hidden';
		s1.empdchk.value="1";
		document.register_form_emailcheck.submit();
	}
}

function check_register_emailcheckpwd()
{
	var emchk = document.getElementById("epwddisp");
	var s1=document.register_form_emailcheck;
	if(s1.emailcheck1.value==''||!(/^\w+([-_\.]?\w+)*@\w+([-_\.]?\w+)*(\.\w{2,4})+$/.test(s1.emailcheck1.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct E-mail ID.");
		s1.emailcheck1.focus();
		return(false);
	}
	else if(s1.pwdcheck.value=='')
	{
		alert("Kindly enter the password.");
		s1.pwdcheck.focus();
		return(false);
	}
	else
	{
// 		emchk.style.display='none';
// 		emchk.style.visibility = 'hidden';
		s1.empdchk.value="2";
		document.register_form_emailcheck.submit();
	}
}

function check_register()
{
var s1=document.register_form;

var regexLetter = /[a-zA-z]/;
var regexzip = /[^0-9a-zA-Z]/;
var dateformat = /(^\d+$)|(^(\d+[-,\s])*\d+(\/\d+)*$)|(^(\d+\s)+\d+$)/;
var nameformat = /(^[a-z,A-Z,0-9]+$)|(^([a-z,A-Z,0-9]+[-,\s])*[a-z,A-Z,0-9]+(\/\d+)*$)/;
var numericform=/\d+/;
var country='';
var j=0;
var sep='';
for (i=0; i<s1.cntryrequirements.length;i++)
{
if (s1.cntryrequirements[i].selected)
{
	j++;
	if(j==1)
	{
	sep='';
	}
	else
	{
	sep=',';
	}
	country = country + sep + s1.cntryrequirements[i].value;
}
}
s1.dee_hide.value=country;
if(s1.company.value=="")
{
alert("Please Enter Company Name!");
s1.company.focus();
return(false);
}
else if(s1.email.value==''||!(/^\w+([-_\.]?\w+)*@\w+([-_\.]?\w+)*(\.\w{2,4})+$/.test(s1.email.value)))
{
alert("Invalid Email ID. Kindly enter the correct E-mail ID.");
s1.email.focus();
return(false);
}
else if(s1.first_name.value=="")
{
alert("Please Enter First Name!");
s1.first_name.focus();
return(false);
}
else if(s1.address.value=="")
{
alert("Please Enter Address!");
s1.address.focus();
return(false);
}
else if(s1.city.value=="")
{
alert("Please Enter City!");
s1.city.focus();
return(false);
}
else if((numericform.test(s1.city.value)))
{
alert("Please Enter Only Alphabets In City !");
s1.city.focus();
return(false);
}
else if((numericform.test(s1.state.value)))
{
alert("Please Enter Either Alphabets In State Or Leave It Blank !");
s1.state.focus();
return(false);
}
else if(s1.zip.value=="")
{
alert("Please Enter Zip code!");
s1.zip.focus();
return(false);
}
else if(!(nameformat.test(s1.zip.value)))
{
alert("Illegal ZIP code. ");
s1.zip.focus();
return(false);
}
else if(s1.country.selectedIndex==0)
{
alert("Please Select Country!");
s1.country.focus();
return(false);
}
else if(s1.pa_code.value=="")
{
alert("Please Enter Phone Area Code!");
s1.pa_code.focus();
return(false);
}
else if(isNaN(s1.pa_code.value))
{
alert("Phone Area Code should be numeric");
s1.pa_code.focus();
return(false);
}
else if(!(dateformat.test(s1.pp_code.value)))
{
alert("Phone Number should be valid");
s1.pp_code.focus();
return(false);
}
else if(s1.apc_code.value!=""&&isNaN(s1.apc_code.value))
{
alert("Alternate Phone Country Code should be numeric Or Leave it Blank");
s1.apc_code.focus();
return(false);
}
else if(s1.apa_code.value!=""&&isNaN(s1.apa_code.value))
{
alert("Alternate Phone Area Code should be numeric Or Leave it Blank");
s1.apa_code.focus();
return(false);
}
else if(s1.app_code.value!=""&&!(dateformat.test(s1.app_code.value)))
{
alert("Alternate Phone Number should be numeric Or Leave it Blank");
s1.app_code.focus();
return(false);
}
else if(s1.mobile.value!=""&&isNaN(s1.mobile.value))
{
alert("Alternate Mobile Number should be numeric Or Leave it Blank");
s1.mobile.focus();
return(false);
}
else if(s1.cntryrequirements.value=="")
{
alert("Please select your Preferred Countries for Tender Notifications!");
s1.cntryrequirements.focus();
return(false);
}
else if(s1.catrequirements.value=="")
{
alert("Please Enter Your Preferred Products/Services!");
s1.catrequirements.focus();
return(false);
}
else if(s1.alt_email.value!=''&&!(/^\w+([-_\.]?\w+)*@\w+([-_\.]?\w+)*(\.\w{2,4})+$/.test(s1.alt_email.value)))
{
alert("Invalid Alternate Email ID. Kindly enter the correct Alternate E-mail ID Or Leave It Blank.");
s1.alt_email.focus();
return(false);
}
return true;
}
function setCookie(name, value){
if(value.length>0)
document.cookie=name+"="+escape(value)+";"+"expires="+expires.toGMTString()+";"
}
function check_update()
{
var s2=document.update_form;
if(s2.password.value.length>0 && s2.password.value!=s2.repassword.value)
{
alert("Please Fill Both Passwords Same!");
s2.repassword.focus();
return(false);
}
else if(s2.first_name.value.length==0)
{
alert("Please Enter First Name!");
s2.first_name.focus();
return(false);
}
else if(s2.last_name.value.length==0)
{
alert("Please Enter Last Name!");
s2.last_name.focus();
return(false);
}
else if(s2.country.selectedIndex==0)
{
alert("Please Select Country!");
s2.country.focus();
return(false);
}
else if(s2.city.value.length==0)
{
alert("Please Enter City!");
s2.city.focus();
return(false);
}
else if(s2.pa_code.value.length==0)
{
alert("Please Enter Phone Area Code!");
s2.pa_code.focus();
return(false);
}
else if(s2.pp_code.value.length==0)
{
alert("Please Enter Phone Number!");
s2.pp_code.focus();
return(false);
}
else if(s2.alt_email.value!='' && !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(s2.alt_email.value)))
{
alert("Invalid Email ID. Kindly enter the correct alternate E-mail ID.");
s2.alt_email.focus();
return(false);
}
return true;
}
function check_login()
{
var s3=document.login_form;
s3.usr_id.value=s3.usr_id.value.replace(/^[\s]+/,'');
s3.usr_id.value=s3.usr_id.value.replace(/[\s]+$/,'');
s3.usr_pass.value=s3.usr_pass.value.replace(/^[\s]/,'');
s3.usr_pass.value=s3.usr_pass.value.replace(/[\s]$/,'');
if(s3.usr_id.value.length==0)
{
alert("Please Enter User Id!");
s3.usr_id.focus();
return(false);
}
else if(s3.usr_pass.value.length==0)
{
alert("Please Enter Password!");
s3.usr_pass.focus();
return(false);
}
return true;
}
function check_feedback()
{
var sb=document.feedback;
var regexLetter = /[a-zA-z]/;
var name=sb.realname.value;
name=name.replace(/^[\s]+/,'').replace(/\s*$/,'');
;
var phone=sb.Phone.value;
phone=phone.replace(/^[\s]+/,'').replace(/\s*$/,'');
var feedback=sb.feedback.value;
feedback=feedback.replace(/^[\s]+/,'').replace(/\s*$/,'');

if(name.length==0)
{
alert("Please Enter Your Name!");
sb.realname.focus();
return(false);
}
else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(sb.email.value)))
{
alert("Please Enter Correct Email Id!");
sb.email.focus();
return(false);
}
else if(phone.length==0)
{
alert("Please Enter Your Phone Number!");
sb.Phone.focus();
return(false);
}
else if(regexLetter.test(sb.Phone.value))
{
alert("Phone Number should not contain alphabets");
sb.Phone.focus();
return(false);
}
else if(sb.country.selectedIndex==0)
{
alert("Please Select Your Country!");
sb.country.focus();
return(false);
}
else if(feedback.length==0)
{
alert("Please Describe Your Feedback!");
sb.feedback.focus();
return(false);
}
return true;
}
function openchild(url,w,h)
{
msgWindow=window.open(url,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width='+w+',height='+h);
msgWindow.focus();
}
function checkcountry()
{
var s1=document.register_form;
window.opener.s1.cntryrequirements.value="";
var count=0;
var sa=document.country;
for(var i=0;i<sa.elements.length;i++)
{
if(sa.elements[i].checked==true)
{
window.opener.s1.cntryrequirements.value=window.opener.s1.cntryrequirements.value + sa.elements[i].value + "\n";
count=count+1;
}
}
window.opener.s1.citycount.value=count;
self.close();
}
function checkonecountry(selectedcheckbox,countrywise)
{
if(countrywise==1)
{
var count1=0;
var sa=document.country;
for(var i=0;i<sa.elements.length;i++)
{
if(sa.elements[i].checked==true && i != selectedcheckbox-1)
{
count1=count1+1;
sa.elements[i].checked=false;
}
}
if(count1>0)
{
alert("You can not select more than one country");
}
}
}
function checkonecategory(selectedcheckbox,catwise)
{
if(catwise==2)
{
var count1=0;
var s4=document.category;
for(var i=0;i<s4.elements.length;i++)
{
if(s4.elements[i].checked==true && i != selectedcheckbox-1 )
{
count1=count1+1;
s4.elements[i].checked=false;
}
}
if(count1>0)
{
alert("You can not select more than one Products/ Services");
}
}
}
function againcheckcountry()
{
var s1=document.register_form;
var all_sel_countries=new Array();
var sa=document.country;
all_sel_countries=window.opener.s1.cntryrequirements.value.split("\n");
for(var i=0;i<sa.elements.length;i++)
{
for(var j=0;j<all_sel_countries.length-1;j++)
{
if(sa.elements[i].value==all_sel_countries[j])
{
sa.elements[i].checked=true;
break;
}
}
}
}
function show_hide_child(child,image)
{
var childid=document.getElementById('child'+child);
if(childid.style.display=="none")
{
childid.style.display="";
image.src="/gifs/minus.gif";
}
else
{
childid.style.display="none";
image.src="/gifs/zero.gif";
}
}
function checkcategory()
{
var s1=document.register_form;
var s4=document.category;
window.opener.s1.catrequirements.value="";
var count=0;
for(var i=0;i<s4.elements.length;i++)
{
if(s4.elements[i].checked==true)
{
window.opener.s1.catrequirements.value=window.opener.s1.catrequirements.value+s4.elements[i].value+"\n\n";
count=count+1;
}
}
window.opener.s1.catcount.value=count;
self.close();
}
function show_hide_products(image)
{
var childid=document.getElementById('products_table');
if(childid.style.display=="none")
{
childid.style.display="";
image.src="/gifs/minus.gif";
}
else
{
childid.style.display="none";
image.src="/gifs/plus.gif";
}
}
function show_hide_services(image)
{
var childid=document.getElementById('services_table');
if(childid.style.display=="none")
{
childid.style.display="";
image.src="/gifs/minus.gif";
}
else
{
childid.style.display="none";
image.src="/gifs/plus.gif";
}
}
function CheckDataSearch(Form)
{
Form.q.value=Form.q.value.replace(/^\s+/g,'').replace(/\s+$/g,'');
if(Form.q.value.length<3)
{
alert("Enter at least three characters for search.");
Form.q.focus();
return false;
}
str='';
str +='q='+Form.q.value;

	if(Form.type.value!=0)
	{
	str +='&type='+Form.type.value;
	}
str = "/search.php?"+str;

 			window.location = str;
 			return false;


}
function addOption_list(){
var s=document.subscriber_form;
for(i=s.Category.options.length-1;i>=0;i--){
var Category=s.Category;
if(s.Category[i].selected){
if(s.country_wise[1].checked)
{
s.addcategory.disabled=true;
s.Category.disabled=true;
}
var k=addOption(s.SubCat, s.Category[i].value, s.Category[i].value);
if(k!=false)
{
removeOption(Category,i);
}
}
}
s.amount.value='';
}
function addOptionCountry_list(){
var s=document.subscriber_form;
for(i=s.Country.options.length-1;i>=0;i--){
var Country=s.Country;
if(s.Country[i].selected){
if(s.country_wise[0].checked)
{
s.addcountry.disabled=true;
s.Country.disabled=true;
}
addOption(s.SubCon, s.Country[i].value, s.Country[i].value);
removeOption(Country,i);
}
}
s.amount.value='';
}
function removeOptions_list(){
var s=document.subscriber_form;
for(i=s.SubCat.options.length-1;i>=0;i--){
var Category=s.SubCat;
if(s.SubCat[i].selected){
if(s.country_wise[1].checked)
{
s.addcategory.disabled=false;
s.Category.disabled=false;
}
addOption(s.Category, s.SubCat[i].value, s.SubCat[i].value);
removeOption(Category,i);
}
}
s.amount.value='';
}
function removeOptionsCountry_list(){
var s=document.subscriber_form;
for(i=s.SubCon.options.length-1;i>=0;i--){
var Country=s.SubCon;
if(s.SubCon[i].selected){
if(s.country_wise[0].checked)
{
s.addcountry.disabled=false;
s.Country.disabled=false;
}
addOption(s.Country, s.SubCon[i].value, s.SubCon[i].value);
removeOption(Country,i);
}
}
s.amount.value='';
}
function move_all_CountryOption(selectbox){
var s=document.subscriber_form;
for(i=s.Country.options.length-1;i>=0;i--){
var Country=s.Country;
addOption(s.SubCon, s.Country[i].value, s.Country[i].value);
}
removeAllOptionsCategory(s.Country);
s.amount.value='';
}
function removeAllOptionsCategory(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
selectbox.remove(i);
}
}
function removeAllOptionsCountry(selectbox)
{
var s=document.subscriber_form;
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
addOption(s.Country, s.SubCon[i].value, s.SubCon[i].value);
selectbox.remove(i);
}
s.amount.value='';
}
function addOption(selectbox,text,value)
{
var s=document.subscriber_form;
if(s.country_wise[0].checked)
{
if(selectbox.name=='SubCat' && selectbox.length==5)
{
alert("You cannot add more than five categories.");
return false;
}
if(selectbox.name=='SubCon' && selectbox.length==1)
{
alert("You cannot add more than one country.");
return false;
}
}
else if(s.country_wise[1].checked)
{
if(selectbox.name=='SubCat' && selectbox.length==1)
{
alert("You cannot add more than One category.");
return false;
}
}
var optn=document.createElement("OPTION");
optn.text=text;
optn.value=value;
selectbox.options.add(optn);
}
function removeOption(listbox,i)
{
listbox.remove(i);
}
function enablebutton()
{
var s=document.subscriber_form;
if(s.country_wise[0].checked)
{
s.addcategory.disabled=false;
s.removecategory.disabled=false;
s.addcountry.disabled=false;
s.addallcountry.disabled=true;
s.removecountry.disabled=false;
s.removeallcountry.disabled=true;
s.Country.disabled=false;
s.Category.disabled=false;
removeAllOptionsCountry(s.SubCon);
removeAllOptionsCategory(s.SubCat);
}
else if(s.country_wise[1].checked)
{
s.addcategory.disabled=false;
s.removecategory.disabled=false;
s.addcountry.disabled=false;
s.addallcountry.disabled=false;
s.removecountry.disabled=false;
s.removeallcountry.disabled=false;
s.Country.disabled=false;
s.Category.disabled=false;
removeAllOptionsCountry(s.SubCon);
removeAllOptionsCategory(s.SubCat);
}
s.amount.value='';
}
function emptyamount()
{
var s=document.subscriber_form;
s.amount.value='';
}
function calculateamount()
{
var s=document.subscriber_form;
myOption=-1;
myOption1=-1;
for(i=s.country_wise.length-1; i>-1; i--){
if(s.country_wise[i].checked){
myOption=i; i=-1;
}
}
var total_cat=s.SubCat.options.length;
var total_con=s.SubCon.options.length;
var total_amount=0;
if(s.country_wise[0].checked)
{
	if(total_con==1 && total_cat>=1)
	{
	if(s.month_wise[0].checked)
	{
	total_amount=399+79*(total_cat-1);
	}
	else if(s.month_wise[1].checked)
	{
	total_amount=599+79*(total_cat-1);
	}
	else if(s.month_wise[2].checked)
	{
	total_amount=599+79*(total_cat-1);
	}
	else if(s.month_wise[3].checked)
	{
	total_amount=599+99*(total_cat-1);
	if(total_amount>1099)
	{
	total_amount=1099;
	}
	}
}
s.amount.value=total_amount;
}
else if(s.country_wise[1].checked)
{
	if(total_cat==1 && total_con>=1)
	{
	if(s.month_wise[0].checked)
	{
	total_amount=399+79*(total_con-1);
	if(total_amount>799)
	{
	total_amount=799;
	}
	}
	else if(s.month_wise[1].checked)
	{
	total_amount=599+79*(total_con-1);
	if(total_amount>1099)
	{
	total_amount=1099;
	}
	}
	else if(s.month_wise[2].checked)
	{
	total_amount=399+79*(total_con-1);
	if(total_amount>799)
	{
	total_amount=799;
	}
	}
	else if(s.month_wise[3].checked)
	{
	total_amount=599+99*(total_con-1);
	if(total_amount>1099)
	{
	total_amount=1099;
	}
	}
}
s.amount.value=total_amount;
}
}
var xmlHttp
function showUser(pid)
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="/includes/tender_payment.php"
url=url+"?pid="+pid
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(xmlHttp.responseText==-1)
{
alert('This tender has been expired.');
return false;
}
else
{
document.tenders.orders_id.value=xmlHttp.responseText;
document.tenders.submit();
}
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}


