function plus1(id,typeval)
{
	getDetail(id,1,typeval);
	document.getElementById("titleSpan").style.fontSize="22px";
	document.getElementById("ds-author").style.fontSize="11px";
	document.getElementById("ds-author1").style.fontSize="11px";
	document.getElementById("ds-intro").style.fontSize="12px";
	document.getElementById("ds-date").style.fontSize="11px";
	document.getElementById("ds-location").style.fontSize="12px";
}

function plus2(id,typeval)
{
	getDetail(id,2,typeval);
	document.getElementById("titleSpan").style.fontSize="26px";
	document.getElementById("ds-author").style.fontSize="16px";
	document.getElementById("ds-author1").style.fontSize="16px";
	document.getElementById("ds-intro").style.fontSize="16px";
	document.getElementById("ds-date").style.fontSize="16px";
	document.getElementById("ds-location").style.fontSize="16px";
}

function plus3(id,typeval)
{
	getDetail(id,3,typeval);
	document.getElementById("titleSpan").style.fontSize="30px";
	document.getElementById("ds-author").style.fontSize="26px";
	document.getElementById("ds-author1").style.fontSize="26px";
	document.getElementById("ds-intro").style.fontSize="20px";
	document.getElementById("ds-date").style.fontSize="26px";
	document.getElementById("ds-location").style.fontSize="26px";
}

function printPart(id,from)
{
	htmfile="art-print.asp?id="+id+"&section="+from;
	popUpWin = window.open(htmfile,'PrintWin','height=310,width=250,toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=yes,resizable=1')
	if (navigator.appName == 'Netscape') {
		popUpWin.focus()
	}
}
function CreateObject()
{
 http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
return http_request;
}
//*************************** Insert Keywords into dictionary **********
function getDetail(id,num,typeval)
{
var url = "ajaxgetDetail.asp";  
 var parameters = "id="+id+"&num="+num+"&typeval="+typeval; 
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
         document.getElementById("detailDiv").innerHTML=xmlHttp.responseText; 
     }  
 }  
 xmlHttp.send(parameters); 	
}
function changeTopic(id)
	{
 var url = "ajaxCat.asp";  
 var parameters = "id="+id; 
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) { 
         document.getElementById("catDrop").innerHTML=xmlHttp.responseText; 
		 document.getElementById("subCatDrop").innerHTML="<select name='subCatId' size='1' class='ds-dropdown' id='subCatId' style='width:200px;'><option>-- Select --</option></style>";
		 document.getElementById("titleList").innerHTML="";
     }  
 }  
 xmlHttp.send(parameters); 
}
function changeCat(id)
	{
 var url = "ajaxSubcat.asp";  
 //var parameters = "id="+encodeURI(document.getElementById("catId").value)+"&subCatId="+encodeURI(document.getElementById("subcat").value);
 var parameters = "topicId="+encodeURI(document.getElementById("topicId").value)+"&id="+id;
// alert(parameters);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	  str=xmlHttp.responseText;
	  var myStr=str.split("$$");
         document.getElementById("subCatDrop").innerHTML=myStr[0];  
          if(myStr[1]=="NA"){if(location.href.indexOf('article-det.asp')>0){document.getElementById("titleList").innerHTML="<br>No Article Found!..";}else{document.getElementById("titleList").innerHTML="No Article Found!..";}}else{
         document.getElementById("titleList").innerHTML=myStr[1];  }  
     }  
 }  
 xmlHttp.send(parameters); 
}

function showResults_paging(url)
{
	//var url = "ajaxArticles.asp";  
 var parameters = "str=jagmohan tyagi";
 //var parameters = "subCatId="+id+"&catId="+encodeURI(document.getElementById("catId").value)+"&topicId="+encodeURI(document.getElementById("topicId").value);
 //alert(url);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true); 
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
         document.getElementById("titleList").innerHTML=xmlHttp.responseText;  
     } else if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3){
		 document.getElementById("titleList").innerHTML="<img src='images/loading.gif'>";
		 } 
 }  
 xmlHttp.send(parameters); 
}
function showResults_pagingAu(url)
{
	//var url = "ajaxArticles.asp";  
 var parameters = "str=jagmohan tyagi";
 //var parameters = "subCatId="+id+"&catId="+encodeURI(document.getElementById("catId").value)+"&topicId="+encodeURI(document.getElementById("topicId").value);
 //alert(url);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true); 
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
         document.getElementById("titleListAu").innerHTML=xmlHttp.responseText;  
     } else if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3){
		 document.getElementById("titleListAu").innerHTML="<img src='images/loading.gif'>";
		 } 
 }  
 xmlHttp.send(parameters); 
}

function changeCatDummy(id)
	{
 var url = "ajaxSubcat.asp";  
 //var parameters = "id="+encodeURI(document.getElementById("catId").value)+"&subCatId="+encodeURI(document.getElementById("subcat").value);
 var parameters = "id="+id;
// alert(parameters);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	  str=xmlHttp.responseText;
	  var myStr=str.split("$");

         document.getElementById("microCat").innerHTML=myStr[0];  
         document.getElementById("microCatHidden").value=myStr[1];  
     }  
 }  
 xmlHttp.send(parameters); 
}
function showSug(id,qtype)
	{
	var url = "AjaxFeedback.asp";  
 //var parameters = "id="+encodeURI(document.getElementById("catId").value)+"&subCatId="+encodeURI(document.getElementById("subcat").value);
 var parameters = "id="+id+"&qtype="+qtype;
// alert(parameters);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	  str=xmlHttp.responseText;
         document.getElementById("feedbackDiv").innerHTML=str;  
     }  
 }  
 xmlHttp.send(parameters); 
	}
	
function submitFeedback(id,qtype)
	{
      var url = "AjaxSubmitFeedback.asp";  
		 if(document.getElementById("txtSubject").value==""){alert("Please Enter Subject for comments.")}
		 else if(document.getElementById("txtName").value==""){alert("Please Enter Your Name.")}
		// else if(document.getElementById("txtEmail").value==""){alert("Please Enter Your Email.")}
		// else if(document.getElementById("txtEmail").value.indexOf('@')<1){alert("Please Enter Your Valid Email.")}
		 else{
 var parameters = "id="+id+"&txtSubject="+encodeURI(document.getElementById("txtSubject").value)+"&txtMessage="+encodeURI(document.getElementById("txtMessage").value)+"&strCAPTCHA="+encodeURI(document.getElementById("strCAPTCHA").value)+"&txtName="+encodeURI(document.getElementById("txtName").value)+"&txtEmail="+encodeURI(document.getElementById("txtEmail").value)+"&qtype="+qtype;
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	  str=xmlHttp.responseText;
         document.getElementById("feedbackDiv").innerHTML=str;
        // document.getElementById("capchaSpan").innerHTML="<img src='"+fCapcha()+"'>";
     }  
 }  
 xmlHttp.send(parameters); 
		 }
	}

	function submitLogin(id,qtype)
	{
			 var url = "AjaxSubmitLogin.asp";  
 var parameters = "id="+id+"&username="+encodeURI(document.getElementById("username").value)+"&password="+encodeURI(document.getElementById("password").value)+"&qtype="+qtype;
// alert(parameters);  
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	  str=xmlHttp.responseText;
         document.getElementById("feedbackDiv").innerHTML=str;  
     }  
 }  
 xmlHttp.send(parameters); 
	}
	
function limitText() {
	limitField=document.getElementById("txtMessage");
	limitNumb=500;
	if (limitField.value.length > limitNumb) {
		limitField.value = limitField.value.substring(0, limitNumb);
	} else {
		document.getElementById("limitNum").innerHTML = limitNumb - limitField.value.length;
	}
}
function changeSubCat(id)
{
	var url = "ajaxArticles.asp";
 var parameters = "subCatId="+id+"&catId="+encodeURI(document.getElementById("catId").value)+"&topicId="+encodeURI(document.getElementById("topicId").value)+"&articleId="+encodeURI(document.getElementById("articleId").value);
 var xmlHttp=new CreateObject();
 xmlHttp.open("POST", url, true);  
 //Send the proper header information along with the request  
 xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
 xmlHttp.setRequestHeader("Content-length", parameters .length);  
 xmlHttp.setRequestHeader("Connection", "close");  
 xmlHttp.onreadystatechange = function() {//Handler function for call back on state change.  
     if(xmlHttp.readyState == 4) {  
	 if(xmlHttp.responseText=="NA"){if(location.href.indexOf('article-det.asp')>0){document.getElementById("titleList").innerHTML="<br>No Article Found!..";}else{document.getElementById("titleList").innerHTML="No Article Found!..";}}else{
         document.getElementById("titleList").innerHTML=xmlHttp.responseText;  }
     } else if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3){
		 document.getElementById("titleList").innerHTML="<img src='images/loading.gif'>";
		 } 
 }  
 xmlHttp.send(parameters); 
}