// JavaScript Document
$(document).ready(function(){
	$('#keyword').focus(function(){
		if(trimAll($('#keyword').val()).toLowerCase() == 'search'){
				$('#keyword').val('');
		}
	});
	$('#keyword').blur(function(){
		if(trimAll($('#keyword').val()).toLowerCase() == 'search' || trimAll($('#keyword').val()).toLowerCase() == ''){
			$('#keyword').val('Search');
		}
	});
	$('a.fileopen').click(function(event){
		event.preventDefault();
		presentation = new lightbox();
		presentation.initCallable('presentation_con');
		presentation.activate();
		relid = $(this).attr('rel');
		$("#pres_ref").val(relid);
	});
	$('#validatePresentationPassword').live('click', function(event, site_url){
		event.preventDefault();
		fileref = $('#pres_ref').val();
		secure = $('#secure_txt').val();
		if(trimAll(secure) == ''){
			alert('Please enter password');
			$('#secure').focus();
			return false;
		}
		imgObj = $('<img />').attr('src', site_url+'images/loader.gif');
		$(this).parent().append(imgObj);	
		//alert($site_url);
		$(this).attr('disabled', true);
		$.ajax({
			url: $site_url+'ajax_func.php',
			async: false,
			data: {			
				'action': 'presentationpassword',
				'fileref': fileref,
				'secure': secure
			},
			type: 'POST',
			cache: false,
			success: function(data) {
				imgObj.remove();
				$(this).attr('disabled', false);
				if(data == 'invalid'){
					alert('Please enter valid password');
					return false;
				}else if(data == 'deleted'){
					alert('The file is no longer available');
					window.location.reload();
				}else{
					presentation.deactivate();
					$('#pres_ref').val('');
					$('#secure_txt').val('');
					window.location.href = data;
				}
											
			}
		});
	});
});
function validateSearch(){
	if(trimAll($('#keyword').val()) == '' || trimAll($('#keyword').val()).toLowerCase() == 'search'){
		alert("Please enter keyword to search");
		$('#keyword').focus();
		return false;
	}
}
function validateLogin(){
	if(TextValidate(document.frmlogin.username, 'Username') == false){
		return false;
	}
	if(TextValidate(document.frmlogin.pwd, 'Password') == false){
		return false;
	}
	return true;
}
function validateRegister(){
	if(TextValidate(document.frmregister.firstname, 'First name') == false){
		return false;
	}
	if(TextValidate(document.frmregister.lastname, 'Lat name') == false){
		return false;
	}
	if(TextValidate(document.frmregister.email, 'Email') == false){
		return false;
	}
	if(EmailValidate(document.frmregister.email, 'Email') == false){
		return false;
	}
	if(TextValidate(document.frmregister.username, 'Username') == false){
		return false;
	}
	if(TextValidate(document.frmregister.pwd, 'Password') == false){
		return false;
	}else if(trimAll(document.frmregister.pwd.value).length > 15){
			alert("Password length should not exceed 15 characters");
			document.frmregister.pwd.focus();
			document.frmregister.pwd.select();
			return false;
	}
	if(TextValidate(document.frmregister.conf_pwd, 'Confirm Password') == false){
		return false;
	}
	if(Comparetextboxesalert(document.frmregister.pwd, document.frmregister.conf_pwd, 'Password', 'Confirm Password')==false){return false;}
	if(SelectValidate(document.frmregister.looking, 'Sector') == false){
		return false;
	}
}
function validateForgot(){
	if(TextValidate(document.frmpwd.username, 'Username') == false){
		return false;
	}
	return true;
}
function validateContact(){
	if(TextValidate(document.frmcontact.firstname, 'First name') == false){
		return false;
	}
	if(TextValidate(document.frmcontact.lastname, 'Lat name') == false){
		return false;
	}
	if(TextValidate(document.frmcontact.email, 'Email') == false){
		return false;
	}
	if(EmailValidate(document.frmcontact.email, 'Email') == false){
		return false;
	}
	if(TextValidate(document.frmcontact.frmcontact, 'Comments') == false){
		return false;
	}
	
}

function ajaxfunctin()
{
	var xmlHttp;
	try
	{
			xmlHttp=new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				alert("browser does not support AJAX");
				return false;
			}
		}
	}
	return xmlHttp;
}

//state start here
var basketHTTP;
		
function addBasket(pid){
	url =  $site_url+"addbasket.php?pid="+pid+"&action=add";
	basketHTTP = ajaxfunctin();					
	basketHTTP.open("GET",url,true); 
	basketHTTP.send(null); 
	basketHTTP.onreadystatechange=getStatusBasket;
}
function getStatusBasket() { 
	if (basketHTTP.readyState == 4) { 	
		var resObj = basketHTTP.responseText; 						
		//document.getElementById("iditemcount").innerHTML = resObj;	
		//alert("Product is added to your cart.");
		window.location.href = $site_url+"cart.php";
	}
} 
//state end here


		//to remove the product from basket
function removeBasket(tmpshopcart_id){
	if(confirm("Are you sure to remove this product from cart?")){
		window.location.href = $site_url+"basketDelete.php?tmpshopcart_id="+tmpshopcart_id;
	}else{
		return false;
	}
}

//to update the product qty in basket page
var basketHTTP;
var qtyObj;
function updateBasket(qtyObj,tmpshopcart_id,flagvalue1){
	flagvalue = qtyObj.value;
	if(isNaN(qtyObj.value) || qtyObj.value == 0 || qtyObj.value.indexOf(".") != -1 || qtyObj.value.indexOf("-") != -1){
		qtyObj.value = qtyObj.value.substr(0,qtyObj.value.length-1);
/*		if(flagvalue == 0 && flagvalue != ''){
			qtyObj.value = document.getElementById('product_qty_hid'+tmpshopcart_id).value;
		}*/
		return false;
	}
    url =  $site_url+"ajax_update_basket.php?tmpshopcart_id="+tmpshopcart_id+"&tmpshopcart_qty="+qtyObj.value+"&flagvalue="+flagvalue1;
	basketHTTP = ajaxfunctin();					
	basketHTTP.open("GET",url,true); 
	basketHTTP.send(null); 
	basketHTTP.onreadystatechange=getStatusUpdateBasket;				
}

function getStatusUpdateBasket() { 
	if (basketHTTP.readyState == 4) { 	
		var result = basketHTTP.responseText; 
		//alert(result);
		//alert(result);
		explode_result = result.split("$$$");
		//document.getElementById("iditemcount").innerHTML = explode_result[0];	
		document.getElementById("idsub_final_price"+explode_result[3]).innerHTML = "&pound;&nbsp;"+explode_result[1];
		document.getElementById("idtotal_price").innerHTML = "TOTAL: &pound;&nbsp;"+explode_result[2];
	}
}

//To validate basket check out page
function validateBasketCheckout(){		
	if(TextValidate(document.frmbasket.address_book_firstname,"First Name")==false) {
		document.frmbasket.address_book_firstname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_firstname.value)) == false){
			alert("Please don't enter the following special characters for First Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_firstname.focus();
			document.frmbasket.address_book_firstname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_firstname.value).length > 50){
		alert("First Name should be less than or equal to 50 characters");
		document.frmbasket.address_book_firstname.focus();
		document.frmbasket.address_book_firstname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_lastname,"Company Name")==false) {
		document.frmbasket.address_book_lastname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_lastname.value)) == false){
			alert("Please don't enter the following special characters for Company Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_lastname.focus();
			document.frmbasket.address_book_lastname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_lastname.value).length > 150){
		alert("Last Name should be less than or equal to 150 characters");
		document.frmbasket.address_book_lastname.focus();
		document.frmbasket.address_book_lastname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_invoice_address,"Address")==false) {
		document.frmbasket.address_book_invoice_address.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_invoice_address.value).length > 255){
		alert("Address should be less than or equal to 255 characters");
		document.frmbasket.address_book_invoice_address.focus();
		document.frmbasket.address_book_invoice_address.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_city,"City")==false) {
		document.frmbasket.address_book_city.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_city.value)) == false){
			alert("Please don't enter the following special characters for City. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_city.focus();
			document.frmbasket.address_book_city.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_city.value).length > 20){
		alert("Characters length of City should be less than or equal to 20");
		document.frmbasket.address_book_city.focus();
		document.frmbasket.address_book_city.select();
		return false;		
	}	
	
	if(TextValidate(document.frmbasket.address_book_zip_code,"Zip Code")==false) {
		document.frmbasket.address_book_zip_code.focus();		
		return false;	
	}else{
		if(isPincode(trimAll(document.frmbasket.address_book_zip_code.value)) == false){
			alert("Please enter the valid Zip Code");
			document.frmbasket.address_book_zip_code.focus();		
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_zip_code.value).length > 20){
		alert("Zip Code should be less than or equal to 20 characters");
		document.frmbasket.address_book_zip_code.focus();
		document.frmbasket.order_zip_code.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_state,"State")==false) {
		document.frmbasket.address_book_state.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_state.value)) == false){
			alert("Please don't enter the following special characters for State. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_state.focus();
			document.frmbasket.address_book_state.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_state.value).length > 20){
		alert("Characters length of State should be less than or equal to 20");
		document.frmbasket.address_book_state.focus();
		document.frmbasket.address_book_state.select();
		return false;		
	}	
		if(SelectValidate(document.frmbasket.address_book_country,"Country")==false) {
		document.frmbasket.address_book_country.focus();		
		return false;	
	}		
	if(TextValidate(document.frmbasket.address_book_mobile,"Mobile Number")==false) {
		document.frmbasket.address_book_mobile.focus();		
		return false;	
	}else{
		if(isPhone(document.frmbasket.address_book_mobile.value) == false){
			document.frmbasket.address_book_mobile.focus();
			alert("Please enter the valid Mobile Number");
			return false;
		}
	}	
	if(trimAll(document.frmbasket.address_book_mobile.value).length > 20){
		alert("Mobile Number should be less than or equal to 20 characters");
		document.frmbasket.address_book_mobile.focus();
		document.frmbasket.address_book_mobile.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_telephone,"Telephone Number")==false) {
		document.frmbasket.address_book_telephone.focus();		
		return false;	
	}else{
		if(isPhone(document.frmbasket.address_book_telephone.value) == false){
			document.frmbasket.address_book_telephone.focus();
			alert("Please enter the valid Telephone Number");
			return false;
		}
	}	
	if(trimAll(document.frmbasket.address_book_telephone.value).length > 20){
		alert("Telephone Number should be less than or equal to 20 characters");
		document.frmbasket.address_book_telephone.focus();
		document.frmbasket.address_book_telephone.select();
		return false;		
	}	
	if(EmailValidate(document.frmbasket.address_book_email,"Email")==false) {
		document.frmbasket.address_book_email.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_email.value).length > 50){
		alert("Email should be less than or equal to 50 characters");
		document.frmbasket.address_book_email.focus();
		document.frmbasket.address_book_email.select();
		return false;		
	}
	document.frmbasket.formflag.value = 'order';
	return true;	
}
function callBasketDeliveryAddress(chkObj){	
	if(chkObj.checked == true){
		document.frmbasket.address_book_del_firstname.value = trimAll(document.frmbasket.address_book_firstname.value);		
		document.frmbasket.address_book_del_companyname.value = trimAll(document.frmbasket.address_book_companyname.value);		
		document.frmbasket.address_book_del_address.value = trimAll(document.frmbasket.address_book_invoice_address.value);	
		
		document.frmbasket.address_book_del_mobile.value = trimAll(document.frmbasket.address_book_mobile.value);		

		document.frmbasket.address_book_del_email.value = trimAll(document.frmbasket.address_book_email.value)
		document.frmbasket.address_book_del_country.value = trimAll(document.frmbasket.address_book_country.value);					
		document.frmbasket.address_book_del_city.value = trimAll(document.frmbasket.address_book_city.value);	
		document.frmbasket.address_book_del_state.value = trimAll(document.frmbasket.address_book_state.value);			
		document.frmbasket.address_book_del_zip_code.value = trimAll(document.frmbasket.address_book_zip_code.value);			
	}else{
		document.frmbasket.address_book_del_firstname.value = '';
		document.frmbasket.address_book_del_companyname.value = '';
		document.frmbasket.address_book_del_address.value = '';		
		document.frmbasket.address_book_del_mobile.value = '';		
		document.frmbasket.address_book_del_email.value = '';
		document.frmbasket.address_book_del_country.value = '';					
		document.frmbasket.address_book_del_city.value = '';	
		document.frmbasket.address_book_del_state.value = '';			
		document.frmbasket.address_book_del_zip_code.value = '';		
	}
}


//To validate basket check out page
function validateBasketCheckoutNew(){
	
	if(TextValidate(document.frmbasket.address_book_firstname,"Name")==false) {
		document.frmbasket.address_book_firstname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_firstname.value)) == false){
			alert("Please don't enter the following special characters for Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_firstname.focus();
			document.frmbasket.address_book_firstname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_firstname.value).length > 50){
		alert("Name should be less than or equal to 50 characters");
		document.frmbasket.address_book_firstname.focus();
		document.frmbasket.address_book_firstname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_companyname,"Company Name")==false) {
		document.frmbasket.address_book_companyname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_companyname.value)) == false){
			alert("Please don't enter the following special characters for Company Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_companyname.focus();
			document.frmbasket.address_book_companyname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_companyname.value).length > 150){
		alert("Company Name should be less than or equal to 150 characters");
		document.frmbasket.address_book_companyname.focus();
		document.frmbasket.address_book_companyname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_invoice_address,"Address")==false) {
		document.frmbasket.address_book_invoice_address.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_invoice_address.value).length > 255){
		alert("Address should be less than or equal to 255 characters");
		document.frmbasket.address_book_invoice_address.focus();
		document.frmbasket.address_book_invoice_address.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_city,"City")==false) {
		document.frmbasket.address_book_city.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_city.value)) == false){
			alert("Please don't enter the following special characters for City. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_city.focus();
			document.frmbasket.address_book_city.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_city.value).length > 20){
		alert("Characters length of City should be less than or equal to 20");
		document.frmbasket.address_book_city.focus();
		document.frmbasket.address_book_city.select();
		return false;		
	}	
	
	if(TextValidate(document.frmbasket.address_book_zip_code,"Zip Code")==false) {
		document.frmbasket.address_book_zip_code.focus();		
		return false;	
	}else{
		if(isPincode(trimAll(document.frmbasket.address_book_zip_code.value)) == false){
			alert("Please enter the valid Zip Code");
			document.frmbasket.address_book_zip_code.focus();		
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_zip_code.value).length > 20){
		alert("Zip Code should be less than or equal to 20 characters");
		document.frmbasket.address_book_zip_code.focus();
		document.frmbasket.order_zip_code.select();
		return false;		
	}		
	if(TextValidate(document.frmbasket.address_book_state,"State")==false) {
		document.frmbasket.address_book_state.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_state.value)) == false){
			alert("Please don't enter the following special characters for State. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_state.focus();
			document.frmbasket.address_book_state.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_state.value).length > 20){
		alert("Characters length of State should be less than or equal to 20");
		document.frmbasket.address_book_state.focus();
		document.frmbasket.address_book_state.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_country,"Country")==false) {
		document.frmbasket.address_book_country.focus();		
		return false;	
	}		
	if(TextValidate(document.frmbasket.address_book_mobile,"Mobile Number")==false) {
		document.frmbasket.address_book_mobile.focus();		
		return false;	
	}else{
		if(isPhone(document.frmbasket.address_book_mobile.value) == false){
			document.frmbasket.address_book_mobile.focus();
			alert("Please enter the valid Mobile Number");
			return false;
		}
	}	
	if(trimAll(document.frmbasket.address_book_mobile.value).length > 20){
		alert("Mobile Number should be less than or equal to 20 characters");
		document.frmbasket.address_book_mobile.focus();
		document.frmbasket.address_book_mobile.select();
		return false;		
	}		
	if(EmailValidate(document.frmbasket.address_book_email,"Email")==false) {
		document.frmbasket.address_book_email.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_email.value).length > 50){
		alert("Email should be less than or equal to 50 characters");
		document.frmbasket.address_book_email.focus();
		document.frmbasket.address_book_email.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_del_firstname,"Name")==false) {
		document.frmbasket.address_book_del_firstname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_del_firstname.value)) == false){
			alert("Please don't enter the following special characters for Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_del_firstname.focus();
			document.frmbasket.address_book_del_firstname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_firstname.value).length > 50){
		alert("Name should be less than or equal to 50 characters");
		document.frmbasket.address_book_del_firstname.focus();
		document.frmbasket.address_book_del_firstname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_del_companyname,"Company Name")==false) {
		document.frmbasket.address_book_del_companyname.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_del_companyname.value)) == false){
			alert("Please don't enter the following special characters for Company Name. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_del_companyname.focus();
			document.frmbasket.address_book_del_companyname.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_companyname.value).length > 150){
		alert("Company Name should be less than or equal to 150 characters");
		document.frmbasket.address_book_del_companyname.focus();
		document.frmbasket.address_book_del_companyname.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_del_jobtitle,"Job Title")==false) {
		document.frmbasket.address_book_del_jobtitle.focus();		
		return false;	
	}
	if(trimAll(document.frmbasket.address_book_del_jobtitle.value).length > 150){
		alert("Job Title should be less than or equal to 150 characters");
		document.frmbasket.address_book_del_jobtitle.focus();
		document.frmbasket.address_book_del_jobtitle.select();
		return false;		
	}
	if(TextValidate(document.frmbasket.address_book_del_address,"Address")==false) {
		document.frmbasket.address_book_del_address.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_del_address.value).length > 255){
		alert("Address should be less than or equal to 255 characters");
		document.frmbasket.address_book_del_address.focus();
		document.frmbasket.address_book_del_address.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_del_city,"City")==false) {
		document.frmbasket.address_book_del_city.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_del_city.value)) == false){
			alert("Please don't enter the following special characters for City. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_del_city.focus();
			document.frmbasket.address_book_del_city.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_city.value).length > 20){
		alert("Characters length of City should be less than or equal to 20");
		document.frmbasket.address_book_del_city.focus();
		document.frmbasket.address_book_del_city.select();
		return false;		
	}	
	
	if(TextValidate(document.frmbasket.address_book_del_zip_code,"Zip Code")==false) {
		document.frmbasket.address_book_del_zip_code.focus();		
		return false;	
	}else{
		if(isPincode(trimAll(document.frmbasket.address_book_del_zip_code.value)) == false){
			alert("Please enter the valid Zip Code");
			document.frmbasket.address_book_del_zip_code.focus();		
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_zip_code.value).length > 20){
		alert("Zip Code should be less than or equal to 20 characters");
		document.frmbasket.address_book_del_zip_code.focus();
		document.frmbasket.order_zip_code.select();
		return false;		
	}	
	if(TextValidate(document.frmbasket.address_book_del_state,"State")==false) {
		document.frmbasket.address_book_del_state.focus();		
		return false;	
	}else{
		if(isSpecialName(trimAll(document.frmbasket.address_book_del_state.value)) == false){
			alert("Please don't enter the following special characters for State. \"{}&/.;-,_+'*()~\\[]!@#$%^");
			document.frmbasket.address_book_del_state.focus();
			document.frmbasket.address_book_del_state.select();
			return false;				
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_state.value).length > 20){
		alert("Characters length of State should be less than or equal to 20");
		document.frmbasket.address_book_del_state.focus();
		document.frmbasket.address_book_del_state.select();
		return false;		
	}		
	if(TextValidate(document.frmbasket.address_book_del_country,"Country")==false) {
		document.frmbasket.address_book_del_country.focus();		
		return false;	
	}			
	if(TextValidate(document.frmbasket.address_book_del_mobile,"Mobile Number")==false) {
		document.frmbasket.address_book_del_mobile.focus();		
		return false;	
	}else{
		if(isPhone(document.frmbasket.address_book_del_mobile.value) == false){
			document.frmbasket.address_book_del_mobile.focus();
			alert("Please enter the valid Mobile Number");
			return false;
		}
	}	
	if(trimAll(document.frmbasket.address_book_del_mobile.value).length > 20){
		alert("Mobile Number should be less than or equal to 20 characters");
		document.frmbasket.address_book_del_mobile.focus();
		document.frmbasket.address_book_del_mobile.select();
		return false;		
	}		
	if(EmailValidate(document.frmbasket.address_book_del_email,"Email")==false) {
		document.frmbasket.address_book_del_email.focus();		
		return false;	
	}	
	if(trimAll(document.frmbasket.address_book_del_email.value).length > 50){
		alert("Email should be less than or equal to 50 characters");
		document.frmbasket.address_book_del_email.focus();
		document.frmbasket.address_book_del_email.select();
		return false;		
	}	
	document.frmbasket.formflag.value = 'order';
	document.frmbasket.submit();
}
function onlineCheckout(){
	document.frmbasket.submit();
}
