<!--Script for sujjest box-->
$con(document).ready(function(){

	$con("#search_txt").autocomplete("ajaxindex_dc.php", {
			width: 200,
			selectFirst: false,
			param:12
		});
});
function clearSearch()
{
	document.getElementById("search_txt").value = "";
}

function searchUrl()
{
	var val		= document.getElementById("search_txt").value;
	var type	= document.getElementById("bookSelect").value;
	//alert('val-'+val+' store-'+sid+' typ-'+type);

	//document.getElementById("sbmtLnk").href = "php/bookSearchResult.php?val="+val+"&type="+type;
	
	if(val)
	{
		document.getElementById("sbmtLnk").href = document.getElementById('site_root').value+"book-search-result/"+val+"/"+type;
	}
	else
	{
		document.getElementById("sbmtLnk").href = document.getElementById('site_root').value+"book-search-result/"+type;
	
	}

}
function sltStore()
{

}
<!--Script for sujjest box-->

<!--  jCarousel skin stylesheets-->

jQuery.noConflict(); 
jQuery(document).ready(function() {
    // Initialise the first and second carousel by class selector.
	// Note that they use both the same configuration options (none in this case).
	jQuery('.first-and-second-carousel').jcarousel();
	
	// If you want to use a caoursel with different configuration options,
	// you have to initialise it seperately.
	// We do it by an id selector here.
	
});

 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17705040-3']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
/****************************************/

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;
}
xmlHttp=GetXmlHttpObject();
function chkSubscribe(frm)
{
	var field = frm.elements["groupid"];
	var selection = false;
	var groupids  = new Array();
	if(field.length > 1){
		for (j = 0; j < field.length; j++){
			if(field[j].checked == true){
				selection = true;
				groupids += '|'+field[j].value;
				//groupids = field[j].value.concat('|'+groupids);
			}
		}
	}else{
		if(field.checked == true)
				selection = true;
		groupids += '|'+ frm.groupid.value;
	}
	if(selection == false){
		alert("Please Select Atleast One Group.");
		return false;
	}
	if(frm.name.value=="")
	{
		alert("Please enter your Name");
		frm.name.focus();
		return false;
	}
	if(frm.location.value=="")
	{
		alert("Please enter your Location");
		frm.location.focus();
		return false;
	}
	if(frm.email.value=="")
	{
		alert("Please enter your Email");
		frm.email.focus();
		return false;
	}
	if(!checkEmail(frm.email.value))
	{
		frm.email.focus();
		return false;
	}
	var tmpname  = document.frmSubscribe.name.value;
	var tmpemail = document.frmSubscribe.email.value;
	var tmplocn  = document.frmSubscribe.location.value;
	var rndno	 = rnd();
	var url="php/ajaxCommon.php?action=Subscribe&name="+tmpname+"&email="+tmpemail+"&location="+tmplocn+"&group_id="+groupids+"&random="+rndno;
	xmlHttp.onreadystatechange=handleState;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function handleState()
{

	if(xmlHttp.readyState==1)
	{
		document.getElementById("subNewsletter").innerHTML='';
		document.getElementById("subNewsletter").innerHTML='<img src="images/loading.gif" alt="" />';
	}

	if (xmlHttp.readyState==4)
	{//alert(xmlHttp.responseText);return false;

		if(xmlHttp.responseText!=1)
		{
			document.getElementById("subNewsletter").innerHTML=xmlHttp.responseText;
			//document.frmSubscribe.reset();
		}
		else
		{//alert(xmlHttp.responseText);
			document.getElementById("subNewsletter").innerHTML='Successfully Added the Subscriber';
			document.frmSubscribe.reset();
		}
	}
}
function rnd(){ return String((new Date()).getTime()).replace(/\D/gi,'') }

function frmSub(bookid)
	{

		document.getElementById('bookId').value=bookid;
		document.home.submit();
	}

/**************************************************/

