 function checksearch(){
 	if(document.searchform.q.value==''){
	alert("Search box is blank");
	document.searchform.q.focus();
	return false;
	}
 }
 

function checksearch(){
 	if(document.searchform.q.value==''){
	alert("Search box is blank");
	document.searchform.q.focus();
	return false;
	}
 }
 $(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});


function emailvalide(){
				 if(document.form44.email_add.value == '')
						{
							alert("Please Provide Email");
							document.form44.email_add.focus();
							return false;
		
					}else{
							var validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
							document.form44.email_add.value;
							if (document.form44.email_add.value.search(validRegExp) == -1) 
								{
									alert("Please Provide Valid Email");
									document.form44.email_add.focus();
									return false;
								}else{
			
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			var userid	=	document.form44.email_add.value;
			var fullurl = 'ajax/addsub.php?email='+userid;
			xmlhttp.open("GET",fullurl,false);
			xmlhttp.send(null);
			document.getElementById('newslettershow').innerHTML=xmlhttp.responseText;
								
								
								}
						}
						
			}
			
function showallproafterleft(id,sesid){
			
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			var fullurl2 = 'ajax/getcheckoutproleft.php?pid='+id+'&sesss='+sesid;
			xmlhttp.open("GET",fullurl2,false);
			xmlhttp.send(null);
			document.getElementById('carthidshowafterdel').innerHTML=xmlhttp.responseText;
						
			}
			
			function showdownloadexamslinks(id,$iub,$orderid){
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			var fullurl2 = 'ajax/getdownloadlinks.php?pid='+id+'&iub='+$iub+'&orderid='+$orderid;
			xmlhttp.open("GET",fullurl2,false);
			xmlhttp.send(null);
			var	newdiv=	"lshowdownloads"+$iub
			document.getElementById(newdiv).innerHTML=xmlhttp.responseText;			
			}
			
			function showallpro(id,sesid){
			
			if (window.XMLHttpRequest)
			{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
			}
			else
			{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			var fullurl3 = 'ajax/getcheckoutpro.php?pid='+id+'&sesss='+sesid;
			xmlhttp.open("GET",fullurl3,false);
			xmlhttp.send(null);
			document.getElementById('showallpro').innerHTML=xmlhttp.responseText;
				
						
			}
			
 function showLeftmenu(){
 $("#showallleft").load("getAllLeft.php");
 }
 
 function showLeft(){
 $("#showallleft").load("getLeft.php");
 }
 
  function signin(){
  
  var	usr	=	document.getElementById('loginemail').value;
  var	pas	=	document.getElementById('loginpassword').value;
	if(usr == '')
	{
		alert("Please Provide Email Address.");
		document.getElementById('loginemail').focus();
		return false;
		
	}else{
				var validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
					if (usr.search(validRegExp) == -1) 
					{
					alert("Please Provide Valid Email");
					document.getElementById('loginemail').focus();
					return false;
					}
		}
	
	if(pas == '')
	{
		alert("Please Provide Password");
		document.getElementById('loginpassword').focus();
		return false;
		
	}
  $('#showsignin').load('getSignin.php?usr='+usr+'&pass='+pas);
	return false;
 }
