function ShowDiv(divid,linkid)
{
	if(document.getElementById(divid).style.display != 'block')
		{ 
			document.getElementById(divid).style.display = 'block'; 
		}
		else
		{ 
		document.getElementById(divid).style.display = 'none';
		} 
		document.getElementById(linkid).style.display = 'none'; 
} 

function showHide(divid)
{
	if(divid=='HotPapers')
	{	
	document.getElementById('ContentHotPapers').style.display = 'block';
	document.getElementById('TabHotPapers').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentHotPapers').style.display = 'none';
	document.getElementById('TabHotPapers').className = 'Tab';
	}
	
	if(divid=='LatestNews')
	{	
	document.getElementById('ContentLatestNews').style.display = 'block';
	document.getElementById('TabLatestNews').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentLatestNews').style.display = 'none';
	document.getElementById('TabLatestNews').className = 'Tab';
	}
	
	if(divid=='Wequest')
	{	
	document.getElementById('ContentWequest').style.display = 'block';
	document.getElementById('TabWequest').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentWequest').style.display = 'none';
	document.getElementById('TabWequest').className = 'Tab';
	}
	
	if(divid=='PressRelease')
	{	
	document.getElementById('ContentPressRelease').style.display = 'block';
	document.getElementById('TabPressRelease').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentPressRelease').style.display = 'none';
	document.getElementById('TabPressRelease').className = 'Tab';
	}
	if(divid=='ReportsForSale')
	{	
	document.getElementById('ContentReportsForSale').style.display = 'block';
	document.getElementById('TabReportsForSale').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentReportsForSale').style.display = 'none';
	document.getElementById('TabReportsForSale').className = 'Tab';
	}
	if(divid=='Education')
	{
	document.getElementById('ContentEducation').style.display = 'block';
	document.getElementById('TabEducation').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentEducation').style.display = 'none';
	document.getElementById('TabEducation').className = 'Tab';
	}

}

function showHideLoginBox(divid)
{
	if(divid=='Member')
	{	
	document.getElementById('ContentMember').style.display = 'block';
	document.getElementById('TabMember').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentMember').style.display = 'none';
	document.getElementById('TabMember').className = 'Tab';
	}
	
	if(divid=='Reseller')
	{	
	document.getElementById('ContentReseller').style.display = 'block';
	document.getElementById('TabReseller').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentReseller').style.display = 'none';
	document.getElementById('TabReseller').className = 'Tab';
	}
	
	if(divid=='Advertiser')
	{	
	document.getElementById('ContentAdvertiser').style.display = 'block';
	document.getElementById('TabAdvertiser').className = 'ActiveTab';
	}
	else
	{
	document.getElementById('ContentAdvertiser').style.display = 'none';
	document.getElementById('TabAdvertiser').className = 'Tab';
	}
}

function showHideHotRecentMembers(divid)
{	

	
	if(divid == 'Hot')
	{	
		//document.getElementById('ContentHot').style.display = 'block';
		document.getElementById('TabHot').className = 'ActiveTab';
	}
	else
	{
		//document.getElementById('ContentHot').style.display = 'none';
		document.getElementById('TabHot').className = 'Tab';
	}
	
	if(divid == 'Recent')
	{	
		//document.getElementById('ContentRecent').style.display = 'block';
		document.getElementById('TabRecent').className = 'ActiveTab';
	}
	else
	{
		//document.getElementById('ContentRecent').style.display = 'none';
		document.getElementById('TabRecent').className = 'Tab';
	}
	
		
	var rnd = Math.random();
	divMembers = document.getElementById('recentMembers');
	xmlHttp=GetXmlHttpObject();
		
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=function ()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			divMembers.innerHTML = xmlHttp.responseText;
		} 
		else
		{
			divMembers.innerHTML ="<div style='height:160px' align='center'><br/><img src=\"/Images/ajax-loader1.gif\" /><b>Loading...</b></div><div class=\"ClearBoth\"></div>";
		}
	}
	
	xmlHttp.open("GET","/get_random_members.php?show="+divid+"&rand="+rnd,true);
	
	xmlHttp.send(null);
	
}

function showBorder(divId)
		{
			var bordering=document.getElementById(divId);
			bordering.style.border="10px solid #CCCCCC" 
		}

		function hideBorder(divId)
		{
			var bordering=document.getElementById(divId);
			bordering.style.border="10px solid transparent" 
		}

		function showLayer(e,layerId,loginId,extraOptions,libOptions,height)
		{
			var mozilla=document.getElementById && !document.all
			var ie = (document.all) ? true : false;
			
			var layers=document.getElementById(layerId);
			var bodyHeight=document.body.scrollHeight-e.clientY;
			//alert(bodyHeight);
			if(e.which==3 || e.button==2)
			{
				layers.style.visibility = 'Visible';

				if( typeof( e.pageX ) == 'number' ) 
				{
					var xcoord = e.pageX;
					var ycoord = e.pageY;
					
					if(bodyHeight<1050)
					{
						layers.style.left=xcoord - 5+ 'px';
						layers.style.top=ycoord - 125 + 'px';
					}
					else
					{
						layers.style.left=xcoord - 5 + 'px';
						layers.style.top=ycoord - 5 + 'px';
					}

					layers.style.height=height;
				} 
				else if( typeof( e.clientX ) == 'number' ) 
				{
					var xcoord = e.clientX;
					var ycoord = e.clientY;

					if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
					{
						xcoord += document.body.scrollLeft;
						ycoord += document.body.scrollTop;
					} 
					else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
					{
						xcoord += document.documentElement.scrollLeft;
						ycoord += document.documentElement.scrollTop;
					}
					
					if(bodyHeight<1050)
					{
						layers.style.left=xcoord - 5+ 'px';
						layers.style.top=ycoord - 130 + 'px';
					}
					else
					{
						layers.style.left=xcoord - 5 + 'px';
						layers.style.top=ycoord - 5 + 'px';
					}

					layers.style.height=height;
				}
			}
			
			/*if (mozilla)
			{
				layers.addEventListener("mouseout", hide_menu, true)
				layers.addEventListener("mouseover", show_menu, true)
			}*/
			/*else if (ie)
			{
				layers.attachEvent("onmouseout", hide_menu)
				layers.attachEvent("onmouseover", show_menu)
			}*/

			xmlHttp=GetXmlHttpObject();
		
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 

			xmlHttp.onreadystatechange=function ()
			{ 
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{ 
					layers.innerHTML =xmlHttp.responseText;
				} 
			}
			
			xmlHttp.open("GET","/Paper/menu_index.php?login_id="+loginId+"&extra_options="+extraOptions+"&library_option="+libOptions+"&sid="+Math.random(),true);
			
			xmlHttp.send(null);
		}
		
		function hide_menu(layer)
		{
			layer.style.visibility='hidden'
		}
		
		function show_menu(layer)
		{
			layer.style.visibility=''
		}
		function blinkIt() 
	{
		if (!document.all) return;
		else 
		{
			for(i=0;i<document.all.tags('blink').length;i++)
			{
				s=document.all.tags('blink')[i];
				s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
			}
		}	
	}	

	function check_http()
	{
		/* not used anymore */		
	}		
	

	function redirect_to_signup()
	{
		var clicks=readCookie('random_clicks');
		var tracker=readCookie('track_user');
		
		clicks=parseInt(clicks);
		tracker=parseInt(tracker);

		if(tracker >= clicks)
		{
			//Added by balraj
			var sPath = window.location;		
			location.href="/User/registration_page.php?error_type=2&action_page="+sPath;
		}
	}
	
function trim(stringValue)
{
	return stringValue.replace(/(^\s*|\s*$)/, "");
}
function validatePost()
{
	var trimmedText=trim(document.postQ.ask.value);
	var wesrchUrl=trim(document.postQ.wesrch_url.value);
	var pattern1=/^http:\/\/.*.wesrch.com.*$/;
	var pattern2=/^https:\/\/.*.wesrch.com.*$/;
	
	if(trimmedText=="")
	{
		alert("Please Post a Question.");
		return false;
	}
	else if(wesrchUrl.length!=0&&!(wesrchUrl.match(pattern1)||wesrchUrl.match(pattern2)))
	{
		//alert(wesrchUrl);
		alert("Invalid URL! \nPlease Refer any wesrch url only.Like http://www.wesrch.com/..");
		document.postQ.wesrch_url.select();
		return false;
	}
	else if(!checkAbuse(document.postQ.ask,"Question"))
	{
		return false;
	}
	else
	{
		createCookie("insertOnce","done",1);
	}
}

function validateAnswer()
{
	var trimmedText=trim(document.postA.answer.value);

	if(trimmedText=="")
	{
		alert("Please Post a Answer.");
		return false;
	}
	else if(!checkAbuse(document.postA.answer,"Answer"))
	{
		return false;
	}
}

function validateAbuse()
{
	var trimmedText=trim(document.postAbuse.abuse.value);

	if(trimmedText=="")
	{
		alert("Please let us know why do you feel this is inappropriate. Please enter a comment.");
		return false;
	}
	else if(!checkAbuse(document.postAbuse.abuse,"Comment"))
	{
		return false;
	}
}

function deleteCookie()
{
	if(readCookie("insertOnce")!="")
		eraseCookie("insertOnce") 
}

function showQuestions(tab)
{
	var content=document.getElementById('content');

	xmlHttp=GetXmlHttpObject();
			
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=function ()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			content.innerHTML =xmlHttp.responseText;
		}
		else
		{
			content.innerHTML="<br><br><p><center><img src='/Images/loading.gif' alt='Loading'></center></p>";
		}
	}
	xmlHttp.open("GET","/ask/ask_wesrch_data.php?tab_id="+tab+"&sid="+Math.random(),true);
		
	xmlHttp.send(null);
}

function show_text(divId,val,e)
{
	var myDiv = document.getElementById(divId);
	if(val<=-1 && (e.keyCode!=8 && e.keyCode!=46 && e.keyCode!=37 && e.keyCode!=38 && e.keyCode!=39 && e.keyCode!=40 && e.keyCode!=16))
	{
		alert("You have exceeded the limit.");
		return false;
	}
	else
	{
		myDiv.innerHTML = val;
	}
}

function incrDecr(thumb,type,id)
{
	var idAppend=""
	var trackId=new Array();
	var askWesrchCookie=readCookie("voteOnce");
	var insertId=id+type;

	if(askWesrchCookie==null)
	{
		idAppend=insertId;
	}
	else
	{
		var chunks=idAppend.split("|");

		for(i=0;i<chunks.length;i++)
		{
			if(insertId!=chunks[i])
			{
				idAppend=askWesrchCookie+"|"+id+type;
			}
		}
	}
	
	var thumbType=thumb.id;
	
	xmlHttp=GetXmlHttpObject();
			
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	xmlHttp.onreadystatechange=function ()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			thumb.innerHTML =xmlHttp.responseText;
			createCookie("voteOnce",idAppend,1);
		} 
	}
	xmlHttp.open("GET","/ask/ask_wesrch_data.php?thumb="+thumbType+"&id="+id+"&type="+type+"&&checkStr="+insertId+"&sid="+Math.random(),true);
		
	xmlHttp.send(null);
}

function glow(content)
{
	content.innerHTML="<img id='abimg' src='/Images/abuse_flag.jpg' style='vertical-align:middle'>&nbsp;&nbsp;Report Abuse";
}

function unglow(content)
{
	content.innerHTML="<img id='abimg' src='/Images/abuse_flag_blank.gif' style='vertical-align:middle'>&nbsp;&nbsp;Report Abuse";
}

function checkAbuse(text,where)
{
	var abuseStr=readCookie("cookie_abusive_words"); 
	
	abuseStr=decodeURI(abuseStr);
	
	abuseList=abuseStr.split("|");

	var trimmedText=trim(text.value);

	var titleArray=trimmedText.split(' ');
	
	for(i=0;i<abuseList.length;i++)
	{	
		for(j=0;j<titleArray.length;j++)
		{
			if(titleArray[j]==abuseList[i])
			{
				alert('Please avoid using abusing words in '+where+'. The word you used was '+abuseList[i]);
				return false;
			}
		}
	}

	return true;
}

var transparentDiv
var newimg
var Sname;
Sname="";

function browserSize()
{
	var bodyWidth = document.documentElement.clientWidth;
    var bodyHeight = document.documentElement.clientHeight;
    	
	var bodyWidth, bodyHeight; 
	
	// all except Explorer 
	if (self.innerHeight)
	{ 
		bodyWidth = self.innerWidth; 
		bodyHeight = self.innerHeight; 
	} 
	   // Explorer 6 Strict Mode 		 
	else if (document.documentElement && document.documentElement.clientHeight) 
	{
		bodyWidth = document.documentElement.clientWidth; 
		bodyHeight = document.documentElement.clientHeight; 
	} 
	// other Explorers 		 
	else if (document.body) 
	{
		bodyWidth = document.body.clientWidth; 
		bodyHeight = document.body.clientHeight; 
	} 
		
	return [bodyWidth,bodyHeight];		
}

function showSaveDialog_search(e,loginId,role,primaryId,searchWord,wordCriteria,graphicsCriteria,dateCriteria,pageCriteria,paperType,searchIn,categoryNames,documentType,sortType,sortParameter,actionPage)
{
	
	if(loginId=="")
	{
		var error="Please login to use this feature.";
		location.href="../Documents/intermidate_page.php?error_data="+error+"&action_page="+actionPage;
	}
	else
	{
			
		var bodyWidth = document.body.scrollWidth;
		var bodyHeight = document.body.scrollHeight;
		
		if(document.body.clientHeight > bodyHeight)
		{
			bodyHeight=document.body.clientHeight;
		}
		
		if(document.body.clientWidth > bodyWidth)
		{
			bodyWidth=document.body.clientWidth;
		}

		var dialog = document.getElementById("saveDialog");
		var fullpage = document.getElementById("fullpage");
		
		dialog.style.visibility=""
		fullpage.style.visibility=""

		fullpage.style.width=bodyWidth+"px"
		fullpage.style.height=bodyHeight+"px"

		fullpage.style.zIndex="1001"
		dialog.style.zIndex="1002"

		if(e.pageX!=null)
		{
			if(e.pageX > 1000)
			{
				dialog.style.left=e.pageX - 240 + "px";
				dialog.style.top=e.pageY + 10 + "px";
			}
			else
			{
				dialog.style.left=e.pageX + 10 + "px";
				dialog.style.top=e.pageY + 10 + "px";
			}
		}
		else
		{
			var xcoord = e.clientX;
			var ycoord = e.clientY;
		
			if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
			{
				xcoord += document.body.scrollLeft;
				ycoord += document.body.scrollTop;
			} 
			else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
			{
				xcoord += document.documentElement.scrollLeft;
				ycoord += document.documentElement.scrollTop;
			}
			
			if(xcoord > 1000)
			{
				dialog.style.left= xcoord - 305  + "px";
				dialog.style.top= ycoord + 10 + "px";
			}
			else
			{
				dialog.style.left= xcoord + 10 + "px";
				dialog.style.top= ycoord + 10 + "px";
			}
		}

		xmlHttp=GetXmlHttpObject();
			
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 

		xmlHttp.onreadystatechange=function ()
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById('saveDialog').innerHTML =xmlHttp.responseText;
			} 
		}
		var qury="login_id="+encodeURIComponent(loginId)+"|role="+encodeURIComponent(role)+"|primary_id="+encodeURIComponent(primaryId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);
		var url="show_save_dialog.php";
		//alert(qury);
		var query="qry="+qury+"&sid="+Math.random();
		var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
		xmlHttp.open("post", url, true);
        xmlHttp.setRequestHeader("Content-Type", contentType);
        xmlHttp.send(query);
	
	
	}
}

function hideSearchDialog()
{
	var dialog = document.getElementById("saveDialog");
	var fullpage = document.getElementById("fullpage");
	
	fullpage.style.visibility="hidden"
	dialog.style.visibility="hidden"

	Sname="";
	
}

function validate_search_save(saveName)
{	
	Sname="";
	Sname=saveName.value;
}

function saveSearchInfo(query,name)
{
	//alert(name);
	if(name=="")
	{
		errorDisplay.innerHTML="<font size='2px' color='red'>Name cannot be empty</font>";
		return false;
	}
	else
	{
		
		xmlHttp=GetXmlHttpObject();
		
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 

		xmlHttp.onreadystatechange=function ()
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				name="";
				document.getElementById('saveDialog').innerHTML =xmlHttp.responseText;
			} 
		}

		//var qury="login_id="+encodeURIComponent(loginId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);
		var url="save_to_library.php";
		var query1="qry="+encodeURIComponent(query)+"|save_name="+encodeURIComponent(name)+"|sid="+Math.random();		
		var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
		xmlHttp.open("post", url, true);
        xmlHttp.setRequestHeader("Content-Type", contentType);
        xmlHttp.send(query1);
	}
}

function show_KeywordAlert(e,loginId,role,primaryId,searchWord,wordCriteria,graphicsCriteria,dateCriteria,pageCriteria,paperType,searchIn,categoryNames,documentType,sortType,sortParameter,actionPage, alertSql)
{


	if(loginId=="")
	{
		var error="Please login to use this feature.";
		location.href="../Documents/intermidate_page.php?error_data="+error+"&action_page="+actionPage;
	}
	else
	{
		var bodyWidth = document.body.scrollWidth;
		var bodyHeight = document.body.scrollHeight;
		
		if(document.body.clientHeight > bodyHeight)
		{
			bodyHeight=document.body.clientHeight;
		}
		
		if(document.body.clientWidth > bodyWidth)
		{
			bodyWidth=document.body.clientWidth;
		}

		var dialog = document.getElementById("KeywordAlert");
		var fullpage = document.getElementById("fullpage");

		dialog.style.visibility=""
		fullpage.style.visibility=""

		fullpage.style.width=bodyWidth+"px"
		fullpage.style.height=bodyHeight+"px"

		fullpage.style.zIndex="1001"
		dialog.style.zIndex="1002"

		if(e.pageX!=null)
		{
			if(e.pageX > 1000)
			{
				dialog.style.left=e.pageX - 240 + "px";
				dialog.style.top=e.pageY + 10 + "px";
			}
			else
			{
				dialog.style.left=e.pageX + 10 + "px";
				dialog.style.top=e.pageY + 10 + "px";
			}
		}
		else
		{
			var xcoord = e.clientX;
			var ycoord = e.clientY;
		
			if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
			{
				xcoord += document.body.scrollLeft;
				ycoord += document.body.scrollTop;
			} 
			else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
			{
				xcoord += document.documentElement.scrollLeft;
				ycoord += document.documentElement.scrollTop;
			}
			
			if(xcoord > 1000)
			{
				dialog.style.left= xcoord - 305  + "px";
				dialog.style.top= ycoord + 10 + "px";
			}
			else
			{
				dialog.style.left= xcoord + 10 + "px";
				dialog.style.top= ycoord + 10 + "px";
			}
		}

		xmlHttp=GetXmlHttpObject();
			
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 

		xmlHttp.onreadystatechange=function ()
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById('KeywordAlert').innerHTML =xmlHttp.responseText;
			} 
		}

		var qury="login_id="+encodeURIComponent(loginId)+"|role="+encodeURIComponent(role)+"|primary_id="+encodeURIComponent(primaryId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);
		var url="show_keyword_alert.php";
		var query="qry="+qury;		
		var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
		xmlHttp.open("post", url, true);
        xmlHttp.setRequestHeader("Content-Type", contentType);
        xmlHttp.send(query);
	
	
	}
}

function hideDialog()
{
	var dialog = document.getElementById("KeywordAlert");
	var fullpage = document.getElementById("fullpage");
	
	fullpage.style.visibility="hidden"
	dialog.style.visibility="hidden"

	Sname="";
	
}

function validate_save(saveName)
{	
	Sname="";
	Sname=saveName.value;
	
}

function saveInfo(query)
{
	//alert(Sname);	
	//if(Sname=="")
	//{
	//	errorDisplay.innerHTML="<font size='2px' color='red'>Name cannot be empty</font>";
	//	return false;
	//}
	//else
	//{
		xmlHttp=GetXmlHttpObject();
		
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 

		xmlHttp.onreadystatechange=function ()
		{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById('KeywordAlert').innerHTML =xmlHttp.responseText;
			} 
		}

		//var qury="login_id="+encodeURIComponent(loginId)+"|search_word="+encodeURIComponent(searchWord)+"|word_criteria="+encodeURIComponent(wordCriteria)+"|graphics_criteria="+encodeURIComponent(graphicsCriteria)+"|date_criteria="+encodeURIComponent(dateCriteria)+"|page_criteria="+encodeURIComponent(pageCriteria)+"|paper_type="+encodeURIComponent(paperType)+"|search_in="+encodeURIComponent(searchIn)+"|category_names="+encodeURIComponent(categoryNames)+"|document_type="+encodeURIComponent(documentType)+"|sort_type="+encodeURIComponent(sortType)+"|sort_parameter="+encodeURIComponent(sortParameter)+"|action_page="+encodeURIComponent(actionPage);
		var url="save_to_alert.php";
		var query1="qry="+encodeURIComponent(query);		
		var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
		xmlHttp.open("post", url, true);
        xmlHttp.setRequestHeader("Content-Type", contentType);
        xmlHttp.send(query1);
		
	//}
}

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

