	function assign()
	{
		
		var pub,tmp;
		pub='';
		for (i=0; i<document.getElementById("00N20000000vcmZ1").length; i++) { 
if (document.getElementById("00N20000000vcmZ1").options[i].selected == true)
{
	pub=pub+document.getElementById("00N20000000vcmZ1").options[i].value+",";
	pub=pub.replace("&","and");

	}
}

tmp=pub.substr(0,pub.length-1);
//tmp=tmp.replace("&","and");
var sb,tmp2;
		sb='';
		for (j=0; j<document.getElementById("Subjects").length; j++) { 
if (document.getElementById("Subjects").options[j].selected == true)
{
	sb=sb+document.getElementById("Subjects").options[j].value+",";
	sb=sb.replace("&","and");
	}
}
tmp2=sb.substr(0,sb.length-1);
document.getElementById("00N20000000vcmZ").value=tmp;
//tmp2=tmp2.replace("&","and");

document.all.retURL.value="http://www.techknowledgeuae.com/submitted.asp?company="+document.all.company.value+"&libtype="+document.all.libtype.value+"&txtnouser="+document.all.txtnouser.value+"&country="+document.all.country.value+"&city="+document.all.city.value+"&first_name="+document.all.first_name.value+"&last_name="+document.all.last_name.value+"&txtrolelib="+document.all.txtrolelib.value+"&title="+document.all.title.value+"&email="+document.all.email.value+"&phone="+document.all.phone.value+"&Subjects="+tmp2+"&00N20000000vcmZ1="+tmp+"&dtstart1="+document.all.dtstart1.value+"&dtstart2="+document.all.dtstart2.value+"&webservices="+document.all.webservices.value+"&whatinfo1="+document.all.whatinfo1.value+"&whatinfo2="+document.all.whatinfo2.value+"&whatinfo1="+document.all.whatinfo3.value+"&whatinfo1="+document.all.whatinfo3.value+"&whatinfo4="+document.all.whatinfo4.value+"&whatinfo5="+document.all.whatinfo5.value+"&whatinfo_other="+document.all.whatinfo_other.value+"&whenbuy="+document.getElementById("whenbuy").value+"&lead_source="+document.all.lead_source.value+"&lead_source_other="+document.all.lead_source_other.value;
		}
		
	EW_dateSep= "/";
	function ToggleLeadSource()
	{
		document.getElementById("whatinfo_other").disabled="";
	
		}
		function validate()
{
		missinginfo = "";
		
		
		 if (document.all.company.value != "")
			{
				
			}
	
		if (document.all.company.value == '')
		{
		missinginfo += "\n     - Please Enter Valid Institute Name ";	
		
		}
		
		 if (document.all.libtype.value != "Please Select")
			{
				
			}
	
		if (document.all.libtype.value == 'Please Select')
		{
		missinginfo += "\n     - Please Select Library Type ";	
		
		}
		
		
		 if (document.all.city.value == "")
			{
				
			}
	
		if (document.all.city.value == '')
		{
		missinginfo += "\n     - Please Enter City";	
		
		}
		 if (document.all.country.value =="")
			{
				
			}
	
		if (document.all.country.value == 'Please Enter Country')
		{
		missinginfo += "\n     - Please Enter Country";	
		
		}
		
		
	
		
		 if (document.all.txtnouser.value != "")
			{
				
			}
	
		if (document.all.txtnouser.value == '')
		{
		missinginfo += "\n     - Please Enter Number of Full time Users";	
		
		}
		if (document.all.first_name.value != "")
			{
				
			}
	
		if (document.all.first_name.value == '')
		{
		missinginfo += "\n     - Please Enter First Name";	
		
		}
		
		if (document.all.last_name.value != "")
			{
				
			}
	
		if (document.all.last_name.value == '')
		{
		missinginfo += "\n     - Please Enter Last Name";	
		
		}
		 if (document.all.title.value != "")
			{
				
			}
	
		if (document.all.title.value == '')
		{
		missinginfo += "\n     - Please Enter Title";	
		
		}
			if (document.all.txtrolelib.value != "")
			{
				
			}
	
		if (document.all.txtrolelib.value == '')
		{
		missinginfo += "\n     - Please Enter Role in Library";	
		
		}
		
		
		
		 if (document.all.email.value != "")
			{
				if (isEmail(document.all.email.value) ==false)
					{
						alert ("Invalid email please Re-Enter Again");
						return false;
					}
			}
	
		if (document.all.email.value == '')
		{
		missinginfo += "\n     - Email is not entered ";	
		
		}
if (document.all.phone.value != "")
			{
				
			}
	
		if (document.all.phone.value == '')
		{
		missinginfo += "\n     - Please Enter Phone No";	
		
		}
		
		
		if (document.all.Subjects.selectedIndex  != "-1")
			{
				
			}
	
		if (document.all.Subjects.selectedIndex == '-1')
		{
		missinginfo += "\n     - Please Select Subject";	
		
		}
		
	//	if (document.all.00N20000000vcmZ.selectedIndex  != "-1")
		//	{
				
		//	}
//	
	//	if (document.all.00N20000000vcmZ.selectedIndex == '-1')
		//{
		//missinginfo += "\n     - Please Select Publisher(s)";	
		
	//	}
	
	
	if (document.all.dtstart1.value != "")
			{
				
			}
	
		if (document.all.dtstart1.value == '')
		{
		missinginfo += "\n     - Please Enter Trial start date";	
		
		}
	
	if (document.all.dtstart2.value != "")
			{
				
			}
	
		if (document.all.dtstart2.value == '')
		{
		missinginfo += "\n     - Please Enter Trial end date";	
		
		}
		if (document.all.whatinfo1.checked != false)
			{
				
			}
	
		if (document.all.whatinfo1.checked ==false && document.all.whatinfo2.checked ==false && document.all.whatinfo3.checked ==false && document.all.whatinfo4.checked ==false && document.all.whatinfo5.checked ==false && document.all.whatinfo_switch.checked ==false )
		{
		missinginfo += "\n     - Please Select options for information";	
		
		}
		if (document.all.whatinfo_switch.checked != false)
			{
				
			}
	
		if ( document.all.whatinfo_switch.checked ==true && document.all.whatinfo_other.value=='' )
		{
		missinginfo += "\n     - Please Enter Other Information";	
		
		}
	if (document.all.lead_source.value != "Please Select")
			{
				
			}
	
		if ( document.all.lead_source.value =='Please Select' )
		{
		missinginfo += "\n     - Please Select Source";	
		
		}
	
	
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly Enter following fields:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter/Select and submit again!";
alert(missinginfo);
return false;
}
else return true;

} // end validate

		
		function goform()
{ if (validate()==false)
{return false;}else {


	//if (isEmail(document.all.email.value)==false)
	//{ alert("Please Enter Valid Email Address");
	//	return false;
	//	} else {
//	alert(isEmail(document.all.email.value));
	document.trialform.submit();
		}
	}
		
function isEmail(who) {
	function isEmpty(who) {
		var testArr=who.split("");
		if(testArr.length==0)
			return true;
		var toggle=0;
		for(var i=0; i<testArr.length; i++) {
			if(testArr[i]==" ") {
				toggle=1;
				break;
			}
		}
		if(toggle)
			return true;
		return false;
	}

	function isValid(who) {
		var invalidChars=new Array("~","!","@","#","$","%","^","&","*","(",")","+","=","[","]",":",";",",","\"","'","|","{","}","\\","/","<",">","?");
		var testArr=who.split("");
		for(var i=0; i<testArr.length; i++) {
			for(var j=0; j<invalidChars.length; j++) {
				if(testArr[i]==invalidChars[j]) {
					return false;
				}
			}
		}
		return true;
	}

	function isfl(who) {
		var invalidChars=new Array("-","_",".");
		var testArr=who.split("");
		which=0;
		for(var i=0; i<2; i++) {
			for(var j=0; j<invalidChars.length; j++) {
				if(testArr[which]==invalidChars[j]) {
					return false;
				}
			}
			which=testArr.length-1;
		}
		return true;
	}

	function isDomain(who) {
		var invalidChars=new Array("-","_",".");
		var testArr=who.split("");
		if(testArr.length<2||testArr.length>4) {
			return false;
		}
		for(var i=0; i<testArr.length; i++) {
			for(var j=0; j<invalidChars.length; j++) {
				if(testArr[i]==invalidChars[j]) {
					return false;
				}
			}
		}
		return true;
	}


	var testArr=who.split("@");
	if(testArr.length<=1||testArr.length>2) {
		return false;
	}
	else {
		if(isValid(testArr[0])&&isfl(testArr[0])&&isValid(testArr[1])) {
			if(!isEmpty(testArr[testArr.length-1])&&!isEmpty(testArr[0])) {
				var testArr2=testArr[testArr.length-1].split(".");
				if(testArr2.length>=2) {
					var toggle=1;
					for(var i=0; i<testArr2.length; i++) {
						if(isEmpty(testArr2[i])||!isfl(testArr2[i])) {
							toggle=0;
							break;
						}
					}
					if(toggle&&isDomain(testArr2[testArr2.length-1]))
						return true;
					return false;
				}
				return false;
			}
		}
	}
}






function hello()
{
	document.getElementById("trialform").reset();
	}

function checkOtherRefer()
{
	document.getElementById("lead_source_other").disabled="";
	}
 
 function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}
 function chklist(name,value)
 {
	// alert(value);
	var chk;
	 var i;
	// alert(name.options.length+value);
	 for(i=name.options.length-1;i>=0;i--)
	 {
		//alert(i+" "+name.options.item(i).value + " " + value)
		if (name.options.item(i).value==value)
		{chk=true;
		break;}
		 }
		 
		 return chk;
	//	return true;
	 }
 function addOptionlist(selectbox, value, text )
{	//var i;
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	//alert(selectbox.options.length)
	
	if (selectbox.options.length !=0 )
	{//alert(selectbox.options.length);	
	//	i = selectbox.options.length-1;
		//while(i!=0)
	//	{
			 //alert(selectbox.item(i).value);
			 //selectbox.options.add(optn);
			// i=i-1;
		//	}
			//selectbox.options.add(optn);
		
		//if (chklist(document.getElementById("00N20000000vcmZ1"),value)==true)
	//	{
		if(chklist(document.getElementById("00N20000000vcmZ1"),optn.value)!=true)
			{selectbox.options.add(optn);}
			
		//	}
		
		//for(i=selectbox.options.length-1;i>=0;i--)
	//	{ alert(selectbox.item(i).value);
			//selectbox.options.remove(i);
			//selectbox.remove(i);
		//	if (selectbox.item(i).value!=value)
		//	{
						//	} else {}
					
					
		//}
		//}
	} else {
					selectbox.options.add(optn);
				
		
		}
	
	//selectbox.options.add(optn);
}


 function addOptionlist2(selectbox, value, text ,status)
{	//var i;

   
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	
	if (status==value)
	{
	
	optn.selected= true;
	
	} else {
		optn.selected= false;
	
	}
	//alert(selectbox.options.length)
	
	if (selectbox.options.length !=0 )
	{//alert(selectbox.options.length);	
	//	i = selectbox.options.length-1;
		//while(i!=0)
	//	{
			 //alert(selectbox.item(i).value);
			 //selectbox.options.add(optn);
			// i=i-1;
		//	}
			//selectbox.options.add(optn);
		
		//if (chklist(document.getElementById("00N20000000vcmZ1"),value)==true)
	//	{
		if(chklist(document.getElementById("00N20000000vcmZ1"),optn.value)!=true)
			{selectbox.options.add(optn);}
			
		//	}
		
		//for(i=selectbox.options.length-1;i>=0;i--)
	//	{ alert(selectbox.item(i).value);
			//selectbox.options.remove(i);
			//selectbox.remove(i);
		//	if (selectbox.item(i).value!=value)
		//	{
						//	} else {}
					
					
		//}
		//}
	} else {
					selectbox.options.add(optn);
				
		
		}
	
	//selectbox.options.add(optn);
}




function yourselection(mySelect)
{
	
	this.document.getElementById("00N20000000vcmZ1").disabled = "";
	removeAllOptions(document.getElementById("00N20000000vcmZ1"));

	//document.write("You've selected the following options:\n")
for (var i = 0; i < mySelect.options.length; i++) {
   if (mySelect.options[i].selected==true && mySelect.options[i].value=="ALL" )
   {//alert(mySelect.options[i].text);
   
   addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Nature","Nature",Request.QueryString("nm"));
	
    addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Access Emergency Med","Access Emergency Med",Request.QueryString("nm"));
	
   addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Access Science McGraw Hill","Access Science McGraw Hill",Request.QueryString("nm"));
   
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Access Medicine McGraw Hill","Access Medicine McGraw Hill",Request.QueryString("nm"));
		 
		 
		 
		 
   addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Society for Testing and Materials","American Society for Testing and Materials",Request.QueryString("nm"));
		
   	 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Association of Computing Machinery","Association of Computing Machinery",Request.QueryString("nm"));
		
    addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Academy of Paediatrics","American Academy of Paediatrics",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Psychiatric Publishing Inc.","American Psychiatric Publishing Inc.",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Chemical Society","American Chemical Society",Request.QueryString("nm"));
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Access Surgery McGraw Hill","Access Surgery McGraw Hill",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Access Pharmacy McGraw Hill","Access Pharmacy McGraw Hill",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Institute of Physics","American Institute of Physics",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Physical Society","American Physical Society",Request.QueryString("nm"));
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "American Welding Society","American Welding Society",Request.QueryString("nm"));
	  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Bentham Science","Bentham Science",Request.QueryString("nm"));
	
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Blackwell","Blackwell",Request.QueryString("nm"));
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Blackwell Synergy","Blackwell Synergy",Request.QueryString("nm"));
			 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "British Standard International","British Standard International",Request.QueryString("nm"));
	  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Brill Online References","Brill Online References",Request.QueryString("nm"));
	
	
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Chemical Abstracts Service","Chemical Abstracts Service",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Cambridge Scientific Abstracts","Cambridge Scientific Abstracts",Request.QueryString("nm"));
    	 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Digital Engineering Library McGraw Hill","Digital Engineering Library McGraw Hill",Request.QueryString("nm"));
			 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Deutsches Institute For Normung e.V.","Deutsches Institute For Normung e.V.",Request.QueryString("nm"));
		
	    addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Ebrary","Ebrary",Request.QueryString("nm"));
			
			 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Harrison's Practice","Harrison's Practice",Request.QueryString("nm"));
		
			addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Humana Press","Humana Press",Request.QueryString("nm"));
			 
	addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Institute of Electrical and Electronic Engineers - Computing Society","Institute of Electrical and Electronic Engineers - Computing Society",Request.QueryString("nm"));
		
	addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Institute of Physics","Institute of Physics",Request.QueryString("nm"));
		
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Keesing's","Keesing's",Request.QueryString("nm"));
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "New England Journal of Medicine","New England Journal of Medicine",Request.QueryString("nm"));
	
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Oxford University Press","Oxford University Press",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Ovid","Ovid",Request.QueryString("nm"));
		
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Project Muse","Project Muse",Request.QueryString("nm"));
		 
		 	 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Sage","Sage",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Science/AAAS","Science/AAAS",Request.QueryString("nm"));
		   addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Springer","Springer",Request.QueryString("nm"));
	
		  addOptionlist2(document.getElementById("00N20000000vcmZ1"), 'Taylor & Francis','Taylor & Francis',Request.QueryString("nm"));
		
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Thieme","Thieme",Request.QueryString("nm"));
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "The Online Metabolic & Molecular Bases of Inherited Disease","The Online Metabolic & Molecular Bases of Inherited Disease",Request.QueryString("nm"));
		
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Worldwide Engineering Exchange","Worldwide Engineering Exchange",Request.QueryString("nm"));
		 	
		 addOptionlist2(document.getElementById("00N20000000vcmZ1"), "World Intellectual Property Search","World Intellectual Property Search",Request.QueryString("nm"));
			 
			
		
	   
	   }
	   
	     if (mySelect.options[i].selected==true && mySelect.options[i].value=="Business and Economics" )
   {//alert(mySelect.options[i].text);
	    addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ebrary","Ebrary");
		  addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		
		
	   
	   }
   
     if (mySelect.options[i].selected==true && mySelect.options[i].value=="Computers and Information Technology" )
   {//alert(mySelect.options[i].text);
	     addOptionlist(document.getElementById("00N20000000vcmZ1"), "Association of Computing Machinery","Association of Computing Machinery");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Institute of Electrical and Electronic Engineers - Computing Society","Institute of Electrical and Electronic Engineers - Computing Society");
		 
		
	   
	   }
	   
	   
	    if (mySelect.options[i].selected==true && mySelect.options[i].value=="Education" )
   {//alert(mySelect.options[i].text);
		 
		  addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ebrary","Ebrary");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Keesing's","Keesing's");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Oxford University Press","Oxford University Press");
		
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Brill Online References","Brill Online References");
		
		
	   
	   }
     if (mySelect.options[i].selected==true && mySelect.options[i].value=="Engineering and Applied Sciences" )
   {//alert(mySelect.options[i].text);
	    addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "American Chemical Society","American Chemical Society");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Chemical Abstracts Service","Chemical Abstracts Service");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Cambridge Scientific Abstracts","Cambridge Scientific Abstracts");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Institute of Physics","Institute of Physics");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Association of Computing Machinery","Association of Computing Machinery");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Institute of Electrical and Electronic Engineers - Computing Society","Institute of Electrical and Electronic Engineers - Computing Society");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Digital Engineering Library McGraw Hill","Digital Engineering Library McGraw Hill");
		
	   
	   }
	  
      if (mySelect.options[i].selected==true && mySelect.options[i].value=="Humanities and Social Sciences" )
   {//alert(mySelect.options[i].text);
	   
	   addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ebrary","Ebrary");
		  addOptionlist(document.getElementById("00N20000000vcmZ1"), "Taylor & Francis","Taylor & Francis");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Sage","Sage");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Keesing's","Keesing's");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Project Muse","Project Muse");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Science/AAAS","Science/AAAS");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Cambridge Scientific Abstracts","Cambridge Scientific Abstracts");
		
	   }
	   
	   
	      if (mySelect.options[i].selected==true && mySelect.options[i].value=="International Standards" )
   {//alert(mySelect.options[i].text);
	   
	 addOptionlist(document.getElementById("00N20000000vcmZ1"), "American Society for Testing and Materials","American Society for Testing and Materials");
	  addOptionlist(document.getElementById("00N20000000vcmZ1"), "British Standard International","British Standard International");
	   addOptionlist(document.getElementById("00N20000000vcmZ1"), "Deutsches Institute For Normung e.V.","Deutsches Institute For Normung e.V.");
		
	   }
	   
	       if (mySelect.options[i].selected==true && mySelect.options[i].value=="International Patents" )
   {//alert(mySelect.options[i].text);
	   
	 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Cambridge Scientific Abstracts","Cambridge Scientific Abstracts");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "World Intellectual Property Search","World Intellectual Property Search");
		
	   }
	   
	    if (mySelect.options[i].selected==true && mySelect.options[i].value=="Life & Physical Sciences" )
   {//alert(mySelect.options[i].text);
	   
	    addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "American Chemical Society","American Chemical Society");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Chemical Abstracts Service","Chemical Abstracts Service");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Cambridge Scientific Abstracts","Cambridge Scientific Abstracts");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Science/AAAS","Science/AAAS");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ovid","Ovid");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Access Science McGraw Hill","Access Science McGraw Hill");
	   }
	   
	   if (mySelect.options[i].selected==true && mySelect.options[i].value=="Medicine and Allied Health" )
   {//alert(mySelect.options[i].text);
   addOptionlist2(document.getElementById("00N20000000vcmZ1"), "Nature","Nature",Request.QueryString("nm"));
	
	  	  addOptionlist(document.getElementById("00N20000000vcmZ1"), "Taylor & Francis","Taylor & Francis");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Science/AAAS","Science/AAAS");
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ovid","Ovid");
		
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "American Academy of Paediatrics","American Academy of Paediatrics");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Thieme","Thieme");
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Bentham Science","Bentham Science");
		
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Access Medicine McGraw Hill","Access Medicine McGraw Hill");
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Harrison's Practice","Harrison's Practice");
		
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Access Emergency Med","Access Emergency Med");
		
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "The Online Metabolic & Molecular Bases of Inherited Disease","The Online Metabolic & Molecular Bases of Inherited Disease");
		
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Blackwell Synergy","Blackwell Synergy");
		
		
	    addOptionlist(document.getElementById("00N20000000vcmZ1"), "Access Surgery McGraw Hill","Access Surgery McGraw Hill");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "New England Journal of Medicine","New England Journal of Medicine");
		
	   }
	   
	    if (mySelect.options[i].selected==true && mySelect.options[i].value=="Petro Chemical" )
   {//alert(mySelect.options[i].text);
	   addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "American Chemical Society","American Chemical Society");
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Chemical Abstracts Service","Chemical Abstracts Service");
		 
			
	   }
	   
	   
	     if (mySelect.options[i].selected==true && mySelect.options[i].value=="Pharmaceuticals" )
   {//alert(mySelect.options[i].text);
	   addOptionlist(document.getElementById("00N20000000vcmZ1"), "Springer","Springer");
		
		 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Chemical Abstracts Service","Chemical Abstracts Service");
		 
			 addOptionlist(document.getElementById("00N20000000vcmZ1"), "Access Pharmacy McGraw Hill","Access Pharmacy McGraw Hill");
			 
			  addOptionlist(document.getElementById("00N20000000vcmZ1"), "Bentham Science","Bentham Science");
		
		addOptionlist(document.getElementById("00N20000000vcmZ1"), "Ovid","Ovid");
		
	   }
   //  
	}
	
	
	listsort('00N20000000vcmZ',0, false, true);
}
	
 function addpub(subject)
	{
		
		yourselection(document.getElementById("Subjects"));
		//if (document.getElementById("00N20000000vcmZ1").options.value
		//if (document.getElementById("Subjects").options.item(document.getElementById("Subjects").selectedindex).value=="ALL" ) 
		
		
		
		
		if (subject=="ALL" )
		{
			//alert("all");
     	
		
		} 
			
			
		//alert(subject);
		
		
		
		//else if (document.getElementById("Subjects").options.item(document.getElementById("Subjects").selectedindex).value=="ALL" ) 
		}
	
	function loadform()
{
	//this.document.getElementById("00N20000000vcmZ1").disabled = "disabled";

//	this.document.getElementById("city").disabled = "disabled";

	//this.document.getElementById("txtothercountry").style.visibility = "hidden";
//this.document.getElementById("city").style.visibility = "hidden";

yourselection(document.getElementById("Subjects"));
		

	}
//removeAllOptions(document.city);

function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "Fruits", "Fruits", "");
addOption(document.drop_list.Category, "Games", "Games", "");
addOption(document.drop_list.Category, "Scripts", "Scripts", "");
}
function removeAllOptions(selectbox)
{
	//alert("hello");
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}



function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

var xmlHttp;
function AddItem(Text,Value)
    {
        // Create an Option object        

        var opt = document.createElement("option");

        // Add an Option object to Drop Down/List Box
        document.getElementById("city").options.add(opt);

        // Assign text and value to Option object
        opt.text = Text;
        opt.value = Value;

    }
function addOpt(selectbox,text,value)
{
var optn = document.createElement("OPTION");
optn.text;
optn.value;
selectbox.options.add(optn);
}


function addOption2(optionText)
{
var objSelect=document.getElementById("city");
objSelect[objSelect.length] = new Option(optionText);
}
function showCities(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="getcities_xml.asp"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText; 
//document.getElementById("test").innerHTML="<OPTION value=test >test</OPTION>"
AddItem("test","test");
//addOption("hello");
//additem("hello","hello");
 //addOpt("city", "text","value");
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}


/*
Sort <SELECT> field script by Babvailiica
www.babailiica.com
version 1.3
*/

function selectall(obj) {
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select")
		return;
	for (var i=0; i<obj.length; i++) {
		obj[i].selected = true;
	}
}

function selectnone(obj) { /* NEW added from version 1.1 */
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select")
		return;
	for (var i=0; i<obj.length; i++) {
		obj[i].selected = false;
	}
}

function swap(obj) { /*updated from version 1.3*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var first_element = false;
	var last_element = false;
	for (var i=0; i<obj.length; i++) {
		if (obj[i].selected) {
			if (first_element === false) {
				first_element = i;
			} else {
				last_element = i;
			}
		}
	}

	if (first_element === false || last_element === false)
		return false;

	var tmp = new Array((document.body.innerHTML ? obj[first_element].innerHTML : obj[first_element].text), obj[first_element].value, obj[first_element].style.color, obj[first_element].style.backgroundColor, obj[first_element].className, obj[first_element].id, obj[first_element].selected);
	if (document.body.innerHTML) obj[first_element].innerHTML = obj[last_element].innerHTML;
	else obj[first_element].text = obj[last_element].text;
	obj[first_element].value = obj[last_element].value;
	obj[first_element].style.color = obj[last_element].style.color;
	obj[first_element].style.backgroundColor = obj[last_element].style.backgroundColor;
	obj[first_element].className = obj[last_element].className;
	obj[first_element].id = obj[last_element].id;
	obj[first_element].selected = obj[last_element].selected;
	if (document.body.innerHTML) obj[last_element].innerHTML = tmp[0];
	else obj[last_element].text = tmp[0];
	obj[last_element].value = tmp[1];
	obj[last_element].style.color = tmp[2];
	obj[last_element].style.backgroundColor = tmp[3];
	obj[last_element].className = tmp[4];
	obj[last_element].id = tmp[5];
	obj[last_element].selected = tmp[6];
}

function additem(obj, text, value, index, id, classname, color, bg, selected) { /* NEW added from version 1.1 updated from version 1.2*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" || text == "")
		return;
	obj.length++;
	if (typeof index == "number" && index < obj.length-1) {
		var i = Number();
		for (i=obj.length-2; i>index-1; i--) {
			if (document.body.innerHTML) obj[i+1].innerHTML = obj[i].innerHTML;
			else obj[i+1].text = obj[i].text;
			obj[i+1].value = obj[i].value;
			obj[i+1].id = obj[i].id;
			obj[i+1].className = obj[i].className;
			obj[i+1].style.color = obj[i].style.color;
			obj[i+1].style.backgroundColor = obj[i].style.backgroundColor;
			obj[i+1].selected = obj[i].selected;
		}
	} else {
		index = obj.length - 1;
	}
	obj = obj[index];
	if (document.body.innerHTML) obj.innerHTML = text;
	else obj.text = text;
	obj.value = value;
	obj.id = id ? id : '';
	obj.className = classname ? classname : '';
	obj.style.color = color ? color : '';
	obj.style.backgroundColor = bg ? bg : '';
	obj.selected = selected
}

function removeitem(obj, index) { /* NEW added from version 1.1 */
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" || obj.length == 0)
		return;
	if (index === true) {
		for (index=obj.length-1; index>=0; index--) {
			if (obj[index].selected) {
				obj[index] = null;
			}
		}
	} else {
		obj[((typeof index != "number") || index > (obj.length - 1) || index < 0 ? obj.length - 1 : index)] = null;
	}
}

function mousewheel(obj) {
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select")
		return;
	if (obj.selectedIndex != -1) {
		if (event.wheelDelta > 0) {
			up(obj);
		} else {
			down(obj);
		}
		return false;
	}
}

function sort2d(arrayName, element, num, cs) {
	if (num) {
		for (var i=0; i<(arrayName.length-1); i++) {
			for (var j=i+1; j<arrayName.length; j++) {
				if (parseInt(arrayName[j][element],10) < parseInt(arrayName[i][element],10)) {
					var dummy = arrayName[i];
					arrayName[i] = arrayName[j];
					arrayName[j] = dummy;
				}
			}
		}
	} else {
		for (var i=0; i<(arrayName.length-1); i++) {
			for (var j=i+1; j<arrayName.length; j++) {
				if (cs) {
					if (arrayName[j][element].toLowerCase() < arrayName[i][element].toLowerCase()) {
						var dummy = arrayName[i];
						arrayName[i] = arrayName[j];
						arrayName[j] = dummy;
					}
				} else {
					if (arrayName[j][element] < arrayName[i][element]) {
						var dummy = arrayName[i];
						arrayName[i] = arrayName[j];
						arrayName[j] = dummy;
					}
				}
			}
		}
	}
}

/* sort the list!
by = 0 - order by text (default)
by = 1 - order by value
by = 2 - order by color
by = 3 - order by background color
by = 4 - order by class name
by = 5 - order by id
num = if true sorts numbers e.g. 2 before 10
cs = casesensitive e.g. a before Z*/
function listsort(obj, by, num, cs) { /*updated from version 1.2*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	by = (parseInt("0" + by) > 5) ? 0 : parseInt("0" + by);
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var elements = new Array();
	for (var i=0; i<obj.length; i++) {
		elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, (obj[i].currentStyle ? obj[i].currentStyle.color : obj[i].style.color), (obj[i].currentStyle ? obj[i].currentStyle.backgroundColor : obj[i].style.backgroundColor), obj[i].className, obj[i].id, obj[i].selected);
	}
	sort2d(elements, by, num, cs);
	for (i=0; i<obj.length; i++) {
		if (document.body.innerHTML) obj[i].innerHTML = elements[i][0];
		else obj[i].text = elements[i][0];
		obj[i].value = elements[i][1];
		obj[i].style.color = elements[i][2];
		obj[i].style.backgroundColor = elements[i][3];
		obj[i].className = elements[i][4];
		obj[i].id = elements[i][5];
		obj[i].selected = elements[i][6];
	}
}

function viceversa(obj, onlyselected) { /*updated from version 1.3*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var elements = new Array();
	for (var i=obj.length-1; i>-1; i--) {
		if (obj[i].selected || !onlyselected) {
			elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, obj[i].style.color, obj[i].style.backgroundColor, obj[i].className, obj[i].id, obj[i].selected);
		}
	}
	var a = 0;
	for (i=0; i<obj.length; i++) {
		if (obj[i].selected || !onlyselected) {
			if (document.body.innerHTML) obj[i].innerHTML = elements[a][0];
			else obj[i].text = elements[a][0];
			obj[i].value = elements[a][1];
			obj[i].style.color = elements[a][2];
			obj[i].style.backgroundColor = elements[a][3];
			obj[i].className = elements[a][4];
			obj[i].id = elements[a][5];
			obj[i].selected = elements[a][6];
			a++;
		}
	}
}

function top(obj) { /*updated from version 1.2*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var elements = new Array();
	for (var i=0; i<obj.length; i++) {
		if (obj[i].selected) {
			elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, obj[i].style.color, obj[i].style.backgroundColor, obj[i].className, obj[i].id, obj[i].selected);
		}
	}
	for (i=0; i<obj.length; i++) {
		if (!obj[i].selected) {
			elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, obj[i].style.color, obj[i].style.backgroundColor, obj[i].className, obj[i].id, obj[i].selected);
		}
	}
	for (i=0; i<obj.length; i++) {
		if (document.body.innerHTML) obj[i].innerHTML = elements[i][0];
		else obj[i].text = elements[i][0];
		obj[i].value = elements[i][1];
		obj[i].style.color = elements[i][2];
		obj[i].style.backgroundColor = elements[i][3];
		obj[i].className = elements[i][4];
		obj[i].id = elements[i][5];
		obj[i].selected = elements[i][6];
	}
}

function bottom(obj) { /*updated from version 1.2*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var elements = new Array();
	for (var i=0; i<obj.length; i++) {
		if (!obj[i].selected) {
			elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, obj[i].style.color, obj[i].style.backgroundColor, obj[i].className, obj[i].id, obj[i].selected);
		}
	}
	for (i=0; i<obj.length; i++) {
		if (obj[i].selected) {
			elements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, obj[i].style.color, obj[i].style.backgroundColor, obj[i].className, obj[i].id, obj[i].selected);
		}
	}
	for (i=obj.length-1; i>-1; i--) {
		if (document.body.innerHTML) obj[i].innerHTML = elements[i][0];
		else obj[i].text = elements[i][0];
		obj[i].value = elements[i][1];
		obj[i].style.color = elements[i][2];
		obj[i].style.backgroundColor = elements[i][3];
		obj[i].className = elements[i][4];
		obj[i].id = elements[i][5];
		obj[i].selected = elements[i][6];
	}
}

function up(obj) { /*updated from version 1.2*/
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var sel = new Array();
	for (var i=0; i<obj.length; i++) {
		if (obj[i].selected == true) {
			sel[sel.length] = i;
		}
	}
	for (i in sel) {
		if (sel[i] != 0 && !obj[sel[i]-1].selected) {
			var tmp = new Array((document.body.innerHTML ? obj[sel[i]-1].innerHTML : obj[sel[i]-1].text), obj[sel[i]-1].value, obj[sel[i]-1].style.color, obj[sel[i]-1].style.backgroundColor, obj[sel[i]-1].className, obj[sel[i]-1].id);
			if (document.body.innerHTML) obj[sel[i]-1].innerHTML = obj[sel[i]].innerHTML;
			else obj[sel[i]-1].text = obj[sel[i]].text;
			obj[sel[i]-1].value = obj[sel[i]].value;
			obj[sel[i]-1].style.color = obj[sel[i]].style.color;
			obj[sel[i]-1].style.backgroundColor = obj[sel[i]].style.backgroundColor;
			obj[sel[i]-1].className = obj[sel[i]].className;
			obj[sel[i]-1].id = obj[sel[i]].id;
			if (document.body.innerHTML) obj[sel[i]].innerHTML = tmp[0];
			else obj[sel[i]].text = tmp[0];
			obj[sel[i]].value = tmp[1];
			obj[sel[i]].style.color = tmp[2];
			obj[sel[i]].style.backgroundColor = tmp[3];
			obj[sel[i]].className = tmp[4];
			obj[sel[i]].id = tmp[5];
			obj[sel[i]-1].selected = true;
			obj[sel[i]].selected = false;
		}
	}
}

function down(obj) {
	obj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (obj.tagName.toLowerCase() != "select" && obj.length < 2)
		return false;
	var sel = new Array();
	for (var i=obj.length-1; i>-1; i--) {
		if (obj[i].selected == true) {
			sel[sel.length] = i;
		}
	}
	for (i in sel) {
		if (sel[i] != obj.length-1 && !obj[sel[i]+1].selected) {
			var tmp = new Array((document.body.innerHTML ? obj[sel[i]+1].innerHTML : obj[sel[i]+1].text), obj[sel[i]+1].value, obj[sel[i]+1].style.color, obj[sel[i]+1].style.backgroundColor, obj[sel[i]+1].className, obj[sel[i]+1].id);
			if (document.body.innerHTML) obj[sel[i]+1].innerHTML = obj[sel[i]].innerHTML;
			else obj[sel[i]+1].text = obj[sel[i]].text;
			obj[sel[i]+1].value = obj[sel[i]].value;
			obj[sel[i]+1].style.color = obj[sel[i]].style.color;
			obj[sel[i]+1].style.backgroundColor = obj[sel[i]].style.backgroundColor;
			obj[sel[i]+1].className = obj[sel[i]].className;
			obj[sel[i]+1].id = obj[sel[i]].id;
			if (document.body.innerHTML) obj[sel[i]].innerHTML = tmp[0];
			else obj[sel[i]].text = tmp[0];
			obj[sel[i]].value = tmp[1];
			obj[sel[i]].style.color = tmp[2];
			obj[sel[i]].style.backgroundColor = tmp[3];
			obj[sel[i]].className = tmp[4];
			obj[sel[i]].id = tmp[5];
			obj[sel[i]+1].selected = true;
			obj[sel[i]].selected = false;
		}
	}
}

function inarray(v,a) {
	for (var i in a) {
		if (a[i] == v) {
			return true;
		}
	}
	return false;
}

// JavaScript Document