// JavaScript Document
	function ShowParagraphs(){
		var strText = document.getElementById('paras').innerHTML;
		document.getElementById('paras').innerHTML = '';
		document.write(strText);
	}
		
	function OrderNow(OrderType, TypeId){
		document.FrmOrderNow.OrderType.value=OrderType;
		document.FrmOrderNow.TypeId.value=TypeId;
		document.FrmOrderNow.Action.value="New";
		document.FrmOrderNow.submit();
	}
	
	function DelCartItem(SrNo){
		document.FrmShoppingCart.SrNo.value=SrNo;
		document.FrmShoppingCart.Action.value="Delete";
		document.FrmShoppingCart.submit();
	}
	
	function UpdateCartItem(SrNo, Qty){
		document.FrmShoppingCart.SrNo.value=SrNo;
		document.FrmShoppingCart.Qty.value=Qty;
		document.FrmShoppingCart.Action.value="Update";
		document.FrmShoppingCart.submit();
	}
	
	function CheckCart(QtyBox){
		if(isNaN(QtyBox.value)==true)
			QtyBox.value=1;
		else if(QtyBox.value<=0)
			QtyBox.value=1;
	}
	
	function CheckEmail(EmailBox){
		var err;
		err=false;
		if(EmailBox.value==''){
			alert("Please enter email!!!");
			err=true;
		}
		else if(!checkemail(EmailBox.value)){
			alert("Invalid email!!!");
			EmailBox.value="";
			err=true;
		}
		return err;
	}
	
	function checkemail(e){
		ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	
		for(i=0; i < e.length ;i++){
			if(ok.indexOf(e.charAt(i))<0) 
				return (false);
		}
		
		if (document.images){
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!e.match(re) && e.match(re_two))
				return (-1);
		}
	}
	
	function ValidateEmailFromDB(EmailBox, Type, FileName){// Also working for signup
		var TempURL;
		ActionCode = 1;
		TempURL=FileName + ".asp?Action="+Type+"&";
		TempURL+="Email="+EmailBox.value;
		if(Type=='Old')
			document.getElementById('signupmsg').innerHTML='Checking email, '+loading;
		else
			document.getElementById('signupmsg').innerHTML='Processing sign up, '+loading;
		AjaxFn(TempURL, 'signupmsg');
	}
	
	function ValidateEmailFromDB1(EmailBox, PasswordBox, Type, FileName){// Also working for signup
		var TempURL;
		ActionCode = 1;
		TempURL=FileName + ".asp?Action="+Type+"&";
		TempURL+="Email="+EmailBox.value+"&";
		TempURL+="Password="+PasswordBox.value;
		if(Type=='Old')
			document.getElementById('signupmsg').innerHTML='Checking email, '+loading;
		else
			document.getElementById('signupmsg').innerHTML='Processing sign up, '+loading;
		
		AjaxFn(TempURL, 'signupmsg');
	}
	
	function ValidateEmailFromDBForLuckyDraw(EmailBox, RequiredExams, Type, FileName){// Also working for signup
		var TempURL;
		ActionCode = 1;
		TempURL=FileName + ".asp?Action="+Type+"&";
		TempURL+="Email="+EmailBox.value+"&";
		TempURL+="RequiredExams="+FixChar(RequiredExams.value);
		if(Type=='Old')
			document.getElementById('signupmsg').innerHTML='Checking email, '+loading;
		else
			document.getElementById('signupmsg').innerHTML='Processing sign up, '+loading;
		AjaxFn(TempURL, 'signupmsg');
	}
	
	function ValidateSignin(FileName, AId){// Also working for signup
		var TempURL;
		ActionCode = AId;
		TempURL=FileName + ".asp?Action=SignIn&";
		TempURL+="Email="+document.FrmSignin.TxtEmail.value+"&";
		TempURL+="Password="+document.FrmSignin.TxtPassword.value+"&";
		TempURL+="RememberMe="+document.FrmSignin.RememberMe.checked;
		document.getElementById('signinmsg').innerHTML='Processing sign in, '+loading;
		AjaxFn(TempURL, 'signinmsg');
		document.FrmSignin.reset();
	}
	
	function ForgotPass(FileName){
		var TempURL;
		ActionCode = 0;
		TempURL=FileName + ".asp?Action=ForgotPassword&";
		TempURL+="Email="+document.FrmForgotPass.TxtEmail.value;
		document.getElementById('forgotpassmsg').innerHTML='Processing password retreival, '+loading;
		AjaxFn(TempURL, 'forgotpassmsg');
		document.FrmForgotPass.reset();
	}
	
	function UpdateProfile(){
		var TempURL;
		ActionCode = 0;
		TempURL="inc-validateemail.asp?Action=Profile&";
		TempURL+="OldPass="+document.FrmProfile.TxtOldPass.value+"&";
		TempURL+="NewPass="+document.FrmProfile.TxtNewPass.value+"&";
		TempURL+="NewConfirmPass="+document.FrmProfile.TxtNewConfirmPass.value;
		document.getElementById('profile').innerHTML='Processing updating password, '+loading;
		AjaxFn(TempURL, 'profile');
		document.FrmProfile.reset();
	}
	
	function SendMail(Form){
		var TempURL;
		ActionCode = 0;
		TempURL="inc-validateemail.asp?Action=ContactUs&";
		TempURL+="FullName="+Form.TxtFullName.value+"&";
		TempURL+="Email="+Form.TxtEmail.value+"&";
		TempURL+="Subject="+FixChar(Form.TxtSubject.value)+"&";
		TempURL+="Message="+FixChar(Form.TxtMessage.value)+"&";
		TempURL+="Priority="+Form.TxtPriority.value+"&";
		TempURL+="Department="+Form.TxtDepartment.value;
		document.getElementById('contactusmsg').innerHTML='Your message is sending, '+loading;
		AjaxFn(TempURL, 'contactusmsg');
		Form.reset();
	}
	
	function SendTestimonial(Form){
		var TempURL;
		ActionCode = 0;
		TempURL="posttestimonial.asp?Action=Post&";
		TempURL+="FullName="+Form.TxtFullName.value+"&";
		TempURL+="Testimonial="+Form.TxtTestimonial.value+"&";
		document.getElementById('confirmation').innerHTML='Testimonial is posting, '+loading;
		AjaxFn(TempURL, 'confirmation');
		Form.reset();
	}
	
	function closeProcessLayer() {
		document.getElementById('ProcessLayer').style.visibility='hidden';
	}
	
	function FixChar(str){
		str = str.replace(/&/g,' And ');
		return str;
	}
	
	function popUp(URL){
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left=262,top=150');");
	}
	
	function ShowText(did){
		var strText = document.getElementById(did).innerHTML;
		document.getElementById(did).innerHTML = '';
		document.write(strText);
	}
	
	function autoResize(id){
		var newheight;
	
		if(document.getElementById){
			newheight = document.getElementById(id).contentWindow.document.body.scrollHeight + 120;
		}
		document.getElementById(id).height = (newheight) + "px";
	}
	
	function Demo(key){
		window.location.href = 'http://www.itsolexpert.com/download.asp?key=' + key;
	}
