// JavaScript Document
// JavaScript Document
<!--

var message="WARNING! Unauthorized reproduction of this document or any portion of it,  may result in severe civil and criminal penalties. \nAll materials on this site subject to Legal Notice (Copyright) including amazed's  and smglgroup's Trademarks\n For product or service comments, visit Feedback\n For site comments, write to webmaster@indianwebstudio.com Right Click Prohibited  \n\nAll Right Reserved. Amazed Corporation";
	function click(e) {
		if (document.all) {
			if (event.button==2||event.button==3) {
			alert(message);			
			return false;
				  }
			  }
		if (document.layers) {
			if (e.which == 3) {
			alert(message);
			return false;
				     }
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

// menu effect
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//Login Check Function :
/*
this function is meant for checking the login details on client end side
*/

function check_login(frm)
	{
	if(frm.userid.value=="")
		{
		frm.userid.focus()
		alert("Please enter the User Id")
		return false		
		}
	if(frm.password.value=="")
		{
		frm.password.focus()
		alert("Please enter the Password")
		return false		
		}		
		
	}
	
		function checkSearchWord(frm)
{
	if(frm.search_word.value=="")
		{
		frm.search_word.focus()
		alert("Please enter the search word")
		return false		
		}
	
}

	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//<!----------------------------------------------------------------------->//
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_add_category(frm)
	{
		if(frm.section_name.value=="")
			{
				alert("Please Enter the Section Name")
				frm.section_name.focus()
				return false
			}
		if(frm.previous_image.value=="")
			{
			if(frm.section_image.value=="")
				{
					alert("Please Select the Section Image")
					frm.section_image.focus()
					return false
				}			
			}
		if(frm.lw_meta_title.value=="")
			{
				alert("Please Enter the Section Meta Title")
				frm.lw_meta_title.focus()
				return false
			}			
		if(frm.section_meta_description.value=="")
			{
				alert("Please Enter the Section Meta Description")
				frm.section_meta_description.focus()
				return false
			}			
		if(frm.section_comment_content.value=="")
			{
				alert("Please Enter the Section Comment Content")
				frm.section_comment_content.focus()
				return false
			}			
		if(frm.section_description.value=="")
			{
				alert("Please Enter the Section Description")
				frm.section_description.focus()
				return false
			}			
			
		
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//Category Addition Check Function :
/*
this function is meant for checking the category addition on client end side
*/

function check_login1(frm)
	{
		
		error=false
		errormsg="Following Errors Occurs while processing Change Password form..."
		
		emailaddress=frm.userid.value
		password=frm.password.value
		new_password=frm.new_password.value	
		re_password=frm.re_password.value	
				
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		if(password=="")	
			{
				errormsg+=" \n\t Please enter the Passwords"
				error=true
			}
		if(new_password!=re_password)	
			{
				errormsg+=" \n\t Re-type Passwords do not match..."
				error=true
			}			
		
		if(error)
			{
				alert(errormsg)
				return false
			}
			return true
					
}


function check_category(frm)
	{
		if(frm.categories_name.value=="")
			{
			alert("Please enter the Categories Name...")
			frm.categories_name.focus()
			return false
			}	
		if(frm.categories_description.value=="")
			{
			alert("Please enter the Categories Description...")
			frm.categories_description.focus()
			return false
			}	
		if(frm.categories_meta_title.value=="")
			{
			alert("Please enter the Categories Meta Title...")
			frm.categories_meta_title.focus()
			return false
			}
		if(frm.categories_meta_description.value=="")
			{
			alert("Please enter the Categories Meta Description...")
			frm.categories_meta_description.focus()
			return false
			}			
		if(frm.categories_comment_content.value=="")
			{
			alert("Please enter the Categories Comment Content...")
			frm.categories_comment_content.focus()
			return false
			}			
		if(isNaN(frm.categories_trade_percentile.value))
			{
			alert("Please enter the Numeric Value for Categories trade percentile...")
			frm.categories_trade_percentile.value=0
			frm.categories_trade_percentile.focus()
			return false
			}			
		if(isNaN(frm.categories_retail_percentile.value))
			{
			alert("Please enter the Numeric Value for Categories retail percentile...")
			frm.categories_retail_percentile.value=0
			frm.categories_retail_percentile.focus()
			return false
			}			
			
	}

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//function to open new window
function open_new_window(winname)
	{
newWindow = window.open(winname,"subWind","status,scrollbars,height=500,width=500");
newWindow.focus( );
	}
	

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_cat_image(frm)	
	{
		
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	


/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_add_product(frm)	
	{
		error=false
		errormsg=""
		if(frm.products_name.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Name \t\t"				
			}
		if(frm.products_price.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Price \t\t"				
			}			
		
		if(frm.products_size.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Size \t\t"				
			}			
		if(frm.products_size_unit.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Size Unit \t\t"				
			}
		if(frm.products_weight.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Weight \t\t"				
			}			
		if(frm.products_weight_unit.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Weight Unit \t\t"				
			}			
		if(frm.products_trade_percentile.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Trade Percentile \t\t"				
			}			
		if(frm.products_retail_percentile.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Retail Percentile \t\t"				
			}			
		if(frm.products_description.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Description \t\t"				
			}
		if(frm.products_comment_content.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Comment Content\t\t"				
			}			
		if(frm.products_meta_title.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Meta Title \t\t"				
			}	
		if(frm.products_meta_keywords.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Meta Keywords\t\t"				
			}	
			
			if(error)
				{
					alert(errormsg)
					return false
				}
				
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//function to check enquiry
function check_enquiry(frm)
	{
		error=false
		errormsg=""
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		name=frm.name.value
		name=trim(name)
		emailaddress=frm.email.value
		emailaddress=trim(emailaddress)
		address=frm.address.value
		address=trim(address)
		city=frm.city.value
		city=trim(city)
		
		country=frm.country.value
		country=trim(country)
		postcode=frm.postcode.value
		postcode=trim(postcode)
		phonenumber=frm.phonenumber.value
		phonenumber=trim(phonenumber)
		query=frm.query.value
		query=trim(query)
	if(name=="")
		{
			error=true
			errormsg+="\n\tPlease enter your name\t\n"
		}
	if(address=="")
		{
			error=true
			errormsg+="\n\tPlease enter your address\t\n"
		}	
		if(city=="")
		{
			error=true
			errormsg+="\n\tPlease enter your city\t\n"
		}	
		if(country=="")
		{
			error=true
			errormsg+="\n\tPlease enter your country\t\n"
		}	
		if(postcode=="")
		{
			error=true
			errormsg+="\n\tPlease enter your postcode\t\n"
		}	
		
		if(phonenumber=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Phonenumber\t\n"
		}	
		else
		{
		var pnumber = phonenumber.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(pnumber))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Phone Number \t\n";
			}
		}
	if(emailaddress=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=emailaddress
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(query=="")
		{
			error=true
			errormsg+="\n\tPlease enter your enquiry...\t\n"
		}	
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
	if(error)	
		{
			alert(errormsg)
			return false
		}
		
	}	
	





function check_form(frm)
	{
		
		error=false
		errormsg=""
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		fname=frm.firstname.value;
	
		lname=frm.lastname.value;
		tphone=frm.telephone.value;
		email=frm.email.value;
		comments=frm.comments.value;
		fname=trim(fname);
		
		lname=trim(lname);
		tphone=trim(tphone);
		email=trim(email);
		comments=trim(comments);
		
	if(fname=="")
		{
			error=true
			errormsg+="\n\tPlease enter your First name\t\n"
		}
		if(lname=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Last name\t\n"
		}
		if(tphone=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Telephone No.\t\n"
		}
		else
		{
		var stripped = tphone.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(stripped))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Telephone No.\t\n";
			}
		}
	if(email=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(comments=="")
		{
			error=true
			errormsg+="\n\tPlease enter your enquiry...\t\n"
		}
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
	
		
		
	if(error)	
		{
			alert(errormsg)
			return false
		}
		
	}
	
	
function add_to_cart(frm)
	{
		if(isNaN(frm.products_quantity.value))
			{
				alert("Please enter proper value for quantity")
				frm.products_quantity.value=3
				return false
			}
		if(frm.products_quantity.value.length == frm.minqty.value.length)
		{
		if(frm.products_quantity.value < frm.minqty.value)
			{
				text= "Minimum Order Quantity is "+ frm.minqty.value+". Please order "+ frm.minqty.value+" or more quantity of product. You have entered"+ frm.products_quantity.value
				alert(text)
				frm.products_quantity.value=frm.minqty.value
				return false
			}
		}
	}
	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
	
function checkUserLogin(frm)	
	{
		user=frm.userid.value
		pass=frm.password.value
		
		if(user=="")
			{
				alert("Please Enter the User Id")
				frm.userid.focus()
				return false
			}
		if(user.indexOf("@")==-1 || user.indexOf(".")==-1 || user.length<6)
			{
				alert("\tPlease Enter the Proper User Id\n\tYour Email you enterted at time of registeration will be treated as your user id\n")
				frm.userid.value=""
				frm.userid.focus()
				return false
			}
		if(pass=="")
			{
				alert("Please Enter the Password")
				frm.password.focus()
				return false
			}			
	}
	
	/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	function checkUserLoginfpwd(frm)	
	{
		user=frm.userid.value
	
		
		if(user=="")
			{
				alert("Please Enter the User Id")
				frm.userid.focus()
				return false
			}
		if(user.indexOf("@")==-1 || user.indexOf(".")==-1 || user.length<6)
			{
				alert("\tPlease Enter the Proper User Id\n\tYour Email you enterted at time of registeration will be treated as your user id\n")
				frm.userid.value=""
				frm.userid.focus()
				return false
			}
					
	}


function same_as_above(frm)
	{
		frm.shippingaddress.value=frm.address.value
		frm.shippingcity.value=frm.city.value
		frm.shippingcountry.value=frm.country.value		
		frm.shippingpostcode.value=frm.postcode.value				
		frm.shippingcounty.value=frm.county.value				
	}
function not_same_as_above(frm)
	{
		frm.shippingaddress.value=''
		frm.shippingcity.value=''
		frm.shippingcountry.value=''	
		frm.shippingpostcode.value=''				
		frm.shippingcounty.value=''
}	
function checkUserRegister(frm)
	{
		error=false
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		errormsg="Following Errors Occurs while processing Registeration form..."
		firstname=frm.firstname.value
		firstname=trim(firstname)
		lastname=frm.lastname.value
		lastname=trim(lastname)
		address=frm.address.value
		address=trim(address)
		city=frm.city.value
		city=trim(city)
		country=frm.country.value
		country=trim(country)
		postcode=frm.postcode.value
		postcode=trim(postcode)
		phonenumber=frm.phonenumber.value
		phonenumber=trim(phonenumber)
		emailaddress=frm.email.value
		emailaddress=trim(emailaddress)
		shippingaddress=frm.shippingaddress.value
		shippingaddress=trim(shippingaddress)
		shippingcity=frm.shippingcity.value
		shippingcity=trim(shippingcity)
		shippingcountry=frm.shippingcountry.value
		shippingcountry=trim(shippingcountry)
		shippingpostcode=frm.shippingpostcode.value
		shippingpostcode=trim(shippingpostcode)
		password=frm.password.value
		password2=frm.password2.value	
		match_image=frm.match_image.value
		match_text=frm.match_text.value
		if(firstname=="")
			{
				errormsg+="\n\t First name is Empty..."
				error=true
			}
		if(lastname=="")
			{
				errormsg+="\n\t Last  name is Empty..."
				error=true
			}			
		if(address=="")
			{
				errormsg+="\n\t Address is Empty..."
				error=true
			}
		if(city=="")
			{
				errormsg+="\n\t City is Empty..."
				error=true
			}
		if(country=="")
			{
				errormsg+="\n\t Country is Empty..."
				error=true
			}			
		if(postcode=="")
			{
				errormsg+="\n\t Postcode is Empty..."
				error=true
			}
		
		if(phonenumber=="")
			{
				errormsg+="\n\t Phonenumber is Empty..."
				error=true
			}
		else
			{
			var pnumber = phonenumber.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(pnumber))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Phone Number.\t\n";
			}
		}	
		if(emailaddress=="")
			{
				errormsg+="\n\t Email Address is Empty..."
				error=true
			}			
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		if(password=="" || password2=="")	
			{
				errormsg+=" \n\t Please enter the Passwords"
				error=true
			}
		if(password!=password2)	
			{
				errormsg+=" \n\t Passwords do not match..."
				error=true
			}			
		if(shippingaddress=="")
			{
				errormsg+="\n\t Shipping Address is Empty..."
				error=true
			}
		if(shippingcity=="")
			{
				errormsg+="\n\t Shipping City is Empty..."
				error=true
			}
		if(shippingcountry=="")
			{
				errormsg+="\n\t Shipping Country is Empty..."
				error=true
			}			
		if(shippingpostcode=="")
			{
				errormsg+="\n\t Shipping Postcode is Empty..."
				error=true
			}
			
		if(match_image!=match_text)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
		
}

/***********************************************************************************************/
// JavaScript Document
// JavaScript Document
<!--

var message="WARNING! Unauthorized reproduction of this document or any portion of it,  may result in severe civil and criminal penalties. \nAll materials on this site subject to Legal Notice (Copyright) including amazed's  and smglgroup's Trademarks\n For product or service comments, visit Feedback\n For site comments, write to webmaster@indianwebstudio.com Right Click Prohibited  \n\nAll Right Reserved. Amazed Corporation";
	function click(e) {
		if (document.all) {
			if (event.button==2||event.button==3) {
			alert(message);			
			return false;
				  }
			  }
		if (document.layers) {
			if (e.which == 3) {
			alert(message);
			return false;
				     }
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

// menu effect
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//Login Check Function :
/*
this function is meant for checking the login details on client end side
*/

function check_login(frm)
	{
	if(frm.userid.value=="")
		{
		frm.userid.focus()
		alert("Please enter the User Id")
		return false		
		}
	if(frm.password.value=="")
		{
		frm.password.focus()
		alert("Please enter the Password")
		return false		
		}		
		
	}
	
		function checkSearchWord(frm)
{
	if(frm.search_word.value=="")
		{
		frm.search_word.focus()
		alert("Please enter the search word")
		return false		
		}
	
}

	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//<!----------------------------------------------------------------------->//
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_add_category(frm)
	{
		if(frm.section_name.value=="")
			{
				alert("Please Enter the Section Name")
				frm.section_name.focus()
				return false
			}
		if(frm.previous_image.value=="")
			{
			if(frm.section_image.value=="")
				{
					alert("Please Select the Section Image")
					frm.section_image.focus()
					return false
				}			
			}
		if(frm.lw_meta_title.value=="")
			{
				alert("Please Enter the Section Meta Title")
				frm.lw_meta_title.focus()
				return false
			}			
		if(frm.section_meta_description.value=="")
			{
				alert("Please Enter the Section Meta Description")
				frm.section_meta_description.focus()
				return false
			}			
		if(frm.section_comment_content.value=="")
			{
				alert("Please Enter the Section Comment Content")
				frm.section_comment_content.focus()
				return false
			}			
		if(frm.section_description.value=="")
			{
				alert("Please Enter the Section Description")
				frm.section_description.focus()
				return false
			}			
			
		
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//Category Addition Check Function :
/*
this function is meant for checking the category addition on client end side
*/

function check_login1(frm)
	{
		
		error=false
		errormsg="Following Errors Occurs while processing Change Password form..."
		
		emailaddress=frm.userid.value
		password=frm.password.value
		new_password=frm.new_password.value	
		re_password=frm.re_password.value	
				
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		if(password=="")	
			{
				errormsg+=" \n\t Please enter the Passwords"
				error=true
			}
		if(new_password!=re_password)	
			{
				errormsg+=" \n\t Re-type Passwords do not match..."
				error=true
			}			
		
		if(error)
			{
				alert(errormsg)
				return false
			}
			return true
					
}


function check_category(frm)
	{
		if(frm.categories_name.value=="")
			{
			alert("Please enter the Categories Name...")
			frm.categories_name.focus()
			return false
			}	
		if(frm.categories_description.value=="")
			{
			alert("Please enter the Categories Description...")
			frm.categories_description.focus()
			return false
			}	
		if(frm.categories_meta_title.value=="")
			{
			alert("Please enter the Categories Meta Title...")
			frm.categories_meta_title.focus()
			return false
			}
		if(frm.categories_meta_description.value=="")
			{
			alert("Please enter the Categories Meta Description...")
			frm.categories_meta_description.focus()
			return false
			}			
		if(frm.categories_comment_content.value=="")
			{
			alert("Please enter the Categories Comment Content...")
			frm.categories_comment_content.focus()
			return false
			}			
		if(isNaN(frm.categories_trade_percentile.value))
			{
			alert("Please enter the Numeric Value for Categories trade percentile...")
			frm.categories_trade_percentile.value=0
			frm.categories_trade_percentile.focus()
			return false
			}			
		if(isNaN(frm.categories_retail_percentile.value))
			{
			alert("Please enter the Numeric Value for Categories retail percentile...")
			frm.categories_retail_percentile.value=0
			frm.categories_retail_percentile.focus()
			return false
			}			
			
	}

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//function to open new window
function open_new_window(winname)
	{
newWindow = window.open(winname,"subWind","status,scrollbars,height=500,width=500");
newWindow.focus( );
	}
	

/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_cat_image(frm)	
	{
		
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	


/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
function check_add_product(frm)	
	{
		error=false
		errormsg=""
		if(frm.products_name.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Name \t\t"				
			}
		if(frm.products_price.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Price \t\t"				
			}			
		
		if(frm.products_size.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Size \t\t"				
			}			
		if(frm.products_size_unit.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Size Unit \t\t"				
			}
		if(frm.products_weight.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Weight \t\t"				
			}			
		if(frm.products_weight_unit.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Weight Unit \t\t"				
			}			
		if(frm.products_trade_percentile.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Trade Percentile \t\t"				
			}			
		if(frm.products_retail_percentile.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Retail Percentile \t\t"				
			}			
		if(frm.products_description.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Description \t\t"				
			}
		if(frm.products_comment_content.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Comment Content\t\t"				
			}			
		if(frm.products_meta_title.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Meta Title \t\t"				
			}	
		if(frm.products_meta_keywords.value=="")
			{
				error=true
				errormsg+="\n\t Please Enter the Products Meta Keywords\t\t"				
			}	
			
			if(error)
				{
					alert(errormsg)
					return false
				}
				
	}
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
//function to check enquiry
function check_enquiry(frm)
	{
		error=false
		errormsg=""
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		name=frm.name.value
		name=trim(name)
		emailaddress=frm.email.value
		emailaddress=trim(emailaddress)
		address=frm.address.value
		address=trim(address)
		city=frm.city.value
		city=trim(city)
		
		country=frm.country.value
		country=trim(country)
		postcode=frm.postcode.value
		postcode=trim(postcode)
		phonenumber=frm.phonenumber.value
		phonenumber=trim(phonenumber)
		query=frm.query.value
		query=trim(query)
	if(name=="")
		{
			error=true
			errormsg+="\n\tPlease enter your name\t\n"
		}
	if(address=="")
		{
			error=true
			errormsg+="\n\tPlease enter your address\t\n"
		}	
		if(city=="")
		{
			error=true
			errormsg+="\n\tPlease enter your city\t\n"
		}	
		if(country=="")
		{
			error=true
			errormsg+="\n\tPlease enter your country\t\n"
		}	
		if(postcode=="")
		{
			error=true
			errormsg+="\n\tPlease enter your postcode\t\n"
		}	
		
		if(phonenumber=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Phonenumber\t\n"
		}	
		else
		{
		var pnumber = phonenumber.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(pnumber))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Phone Number \t\n";
			}
		}
	if(emailaddress=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			email=emailaddress
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(query=="")
		{
			error=true
			errormsg+="\n\tPlease enter your enquiry...\t\n"
		}	
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
	if(error)	
		{
			alert(errormsg)
			return false
		}
		
	}	
	





function check_form(frm)
	{
		
		error=false
		errormsg=""
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		fname=frm.firstname.value;
	
		lname=frm.lastname.value;
		tphone=frm.telephone.value;
		email=frm.email.value;
		comments=frm.comments.value;
		fname=trim(fname);
		
		lname=trim(lname);
		tphone=trim(tphone);
		email=trim(email);
		comments=trim(comments);
		
	if(fname=="")
		{
			error=true
			errormsg+="\n\tPlease enter your First name\t\n"
		}
		if(lname=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Last name\t\n"
		}
		if(tphone=="")
		{
			error=true
			errormsg+="\n\tPlease enter your Telephone No.\t\n"
		}
		else
		{
		var stripped = tphone.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(stripped))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Telephone No.\t\n";
			}
		}
	if(email=="")
		{
			error=true
			errormsg+="\n\tPlease enter your email address\t\n"
		}
	else
		{
			
			if(email.indexOf("@")==-1 || email.indexOf(".")==-1 || email.length<5)
				{
					error=true
					errormsg+="Please enter the proper email address..."
				}
		}
		if(comments=="")
		{
			error=true
			errormsg+="\n\tPlease enter your enquiry...\t\n"
		}
		if(frm.match_image.value!=frm.match_text.value)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}	
	
		
		
	if(error)	
		{
			alert(errormsg)
			return false
		}
		
	}
	
	
function add_to_cart(frm)
	{
		if(isNaN(frm.products_quantity.value))
			{
				alert("Please enter proper value for quantity")
				frm.products_quantity.value=3
				return false
			}
		if(frm.products_quantity.value.length == frm.minqty.value.length)
		{
		if(frm.products_quantity.value < frm.minqty.value)
			{
				text= "Minimum Order Quantity is "+ frm.minqty.value+". Please order "+ frm.minqty.value+" or more quantity of product. You have entered"+ frm.products_quantity.value
				alert(text)
				frm.products_quantity.value=frm.minqty.value
				return false
			}
		}
	}
	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
	
/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	
	
function checkUserLogin(frm)	
	{
		user=frm.userid.value
		pass=frm.password.value
		
		if(user=="")
			{
				alert("Please Enter the User Id")
				frm.userid.focus()
				return false
			}
		if(user.indexOf("@")==-1 || user.indexOf(".")==-1 || user.length<6)
			{
				alert("\tPlease Enter the Proper User Id\n\tYour Email you enterted at time of registeration will be treated as your user id\n")
				frm.userid.value=""
				frm.userid.focus()
				return false
			}
		if(pass=="")
			{
				alert("Please Enter the Password")
				frm.password.focus()
				return false
			}			
	}
	
	/**-*-*-*-*-*-*-*-*-*-*-*-**-*-*--*-***-**-*-*-*-*-*-*-*-*-*-*-*-*-**-***-**-*-*-*-*-*-*-*-***-*-*/	function checkUserLoginfpwd(frm)	
	{
		user=frm.userid.value
	
		
		if(user=="")
			{
				alert("Please Enter the User Id")
				frm.userid.focus()
				return false
			}
		if(user.indexOf("@")==-1 || user.indexOf(".")==-1 || user.length<6)
			{
				alert("\tPlease Enter the Proper User Id\n\tYour Email you enterted at time of registeration will be treated as your user id\n")
				frm.userid.value=""
				frm.userid.focus()
				return false
			}
					
	}


function same_as_above(frm)
	{
		frm.shippingaddress.value=frm.address.value
		frm.shippingcity.value=frm.city.value
		frm.shippingcountry.value=frm.country.value		
		frm.shippingpostcode.value=frm.postcode.value				
		frm.shippingcounty.value=frm.county.value				
	}
function not_same_as_above(frm)
	{
		frm.shippingaddress.value=''
		frm.shippingcity.value=''
		frm.shippingcountry.value=''	
		frm.shippingpostcode.value=''				
		frm.shippingcounty.value=''
}	
function checkUserRegister(frm)
	{
		error=false
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		errormsg="Following Errors Occurs while processing Registeration form..."
		firstname=frm.firstname.value
		firstname=trim(firstname)
		lastname=frm.lastname.value
		lastname=trim(lastname)
		address=frm.address.value
		address=trim(address)
		city=frm.city.value
		city=trim(city)
		country=frm.country.value
		country=trim(country)
		postcode=frm.postcode.value
		postcode=trim(postcode)
		phonenumber=frm.phonenumber.value
		phonenumber=trim(phonenumber)
		emailaddress=frm.email.value
		emailaddress=trim(emailaddress)
		shippingaddress=frm.shippingaddress.value
		shippingaddress=trim(shippingaddress)
		shippingcity=frm.shippingcity.value
		shippingcity=trim(shippingcity)
		shippingcountry=frm.shippingcountry.value
		shippingcountry=trim(shippingcountry)
		shippingpostcode=frm.shippingpostcode.value
		shippingpostcode=trim(shippingpostcode)
		password=frm.password.value
		password2=frm.password2.value	
		match_image=frm.match_image.value
		match_text=frm.match_text.value
		if(firstname=="")
			{
				errormsg+="\n\t First name is Empty..."
				error=true
			}
		if(lastname=="")
			{
				errormsg+="\n\t Last  name is Empty..."
				error=true
			}			
		if(address=="")
			{
				errormsg+="\n\t Address is Empty..."
				error=true
			}
		if(city=="")
			{
				errormsg+="\n\t City is Empty..."
				error=true
			}
		if(country=="")
			{
				errormsg+="\n\t Country is Empty..."
				error=true
			}			
		if(postcode=="")
			{
				errormsg+="\n\t Postcode is Empty..."
				error=true
			}
		
		if(phonenumber=="")
			{
				errormsg+="\n\t Phonenumber is Empty..."
				error=true
			}
		else
			{
			var pnumber = phonenumber.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(pnumber))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Phone Number.\t\n";
			}
		}	
		if(emailaddress=="")
			{
				errormsg+="\n\t Email Address is Empty..."
				error=true
			}			
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		if(password=="" || password2=="")	
			{
				errormsg+=" \n\t Please enter the Passwords"
				error=true
			}
		if(password!=password2)	
			{
				errormsg+=" \n\t Passwords do not match..."
				error=true
			}			
		if(shippingaddress=="")
			{
				errormsg+="\n\t Shipping Address is Empty..."
				error=true
			}
		if(shippingcity=="")
			{
				errormsg+="\n\t Shipping City is Empty..."
				error=true
			}
		if(shippingcountry=="")
			{
				errormsg+="\n\t Shipping Country is Empty..."
				error=true
			}			
		if(shippingpostcode=="")
			{
				errormsg+="\n\t Shipping Postcode is Empty..."
				error=true
			}
			
		if(match_image!=match_text)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
		
}

/***********************************************************************************************/
function checkUserAddEnquiry(frm)
	{
		error=false
		function LTrim(value)
		{
        	var re = /\s*((\S+\s*)*)/;
	   		return value.replace(re, "$1");
     	}
       // Removes ending whitespaces
     	function RTrim(value)
 		{
    		var re = /((\s*\S+)*)\s*/;
    		return value.replace(re, "$1");
  		}// Removes leading and ending whitespaces
    	function trim(value)
		{
        	return LTrim(RTrim(value));
		}
		errormsg="Following Errors Occurs while processing Enquiry form..."
		name=frm.name.value
		name=trim(name)
		emailaddress=frm.email.value
		emailaddress=trim(emailaddress)
		address=frm.address.value
		address=trim(address)
		city=frm.city.value
		city=trim(city)
		
		country=frm.country.value
		country=trim(country)
		postcode=frm.postcode.value
		postcode=trim(postcode)
		phonenumber=frm.phonenumber.value
		phonenumber=trim(phonenumber)
		query=frm.query.value
		query=trim(query)
		
		match_image=frm.match_image.value
		match_text=frm.match_text.value
		if(name=="")
			{
				errormsg+="\n\t Name is Empty..."
				error=true
			}
			if(emailaddress=="")
			{
				errormsg+="\n\t Email Address is Empty..."
				error=true
			}	
				
		if(address=="")
			{
				errormsg+="\n\t Address is Empty..."
				error=true
			}
		if(city=="")
			{
				errormsg+="\n\t City is Empty..."
				error=true
			}
			
		if(country=="")
			{
				errormsg+="\n\t Country is Empty..."
				error=true
			}			
		if(postcode=="")
			{
				errormsg+="\n\t Postcode is Empty..."
				error=true
			}
			
			if(phonenumber=="")
			{
				errormsg+="\n\t Phone Number is Empty..."
				error=true
			}
			else
		{
		var tphone = phonenumber.replace(/[\(\)\.\-\ ]/g, '');
		//strip out acceptable non-numeric characters
			if (isNaN(parseInt(tphone))) 
			{
			error=true
			errormsg+="\n\tPlease enter valid Phone Number.\t\n";
			}
		}
			if(query=="")
			{
				errormsg+="\n\t Query is Empty..."
				error=true
			}

				
		if(emailaddress.indexOf("@")==-1 || emailaddress.indexOf("@")==-1 || emailaddress.length<6)
			{
				errormsg+="\n\t Please enter Proper Email Address..."
				error=true
			}
		
		if(match_image!=match_text)
			{
				errormsg+="\n\t Given String does not match..."
				error=true
			}
		if(error)
			{
				alert(errormsg)
				return false
			}
		
}




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

