﻿function goRegister(){
	location.href="./index.php?PageName=register";
}
function request_sample() {
	var form = document.request_sample_form;
	if( form.user_id.value == '' ){
		alert('Please, input the user id');
		form.user_id.focus();
		return;
	}
	if( form.company.value == '' ){
		alert('Please, input the company');
		form.company.focus();
		return;
	}
	if( form.contact_name.value == '' ){
		alert('Please, input the contact name');
		form.contact_name.focus();
		return;
	}
	if( form.item_number.value == '' ){
		alert( 'Please, input the items');
		form.item_number.focus();
		return;
	}
	if( form.address.value == '' ){
		alert('Please, input the address' );
		form.address.focus();
		return;
	}
	if( form.city.value == '' ){
		alert( 'Please, input the city' );
		form.city.focus();
		return;
	}
	if( form.state.value == '' ){
		alert( 'Please, input the state' );
		form.state.focus();
		return;
	}
	if( form.zipcode.value == '' ){
		alert( 'Please, input the zipcode' );
		form.zipcode.focus();
		return;
	}
	form.submit();
}
function request_order() {
	var form = document.request_order_form;
	if( form.user_id.value == '' ){
		alert('Please, input the user id');
		form.user_id.focus();
		return;
	}
	if( form.company.value == '' ){
		alert('Please, input the company');
		form.company.focus();
		return;
	}
	if( form.contact_name.value == '' ){
		alert('Please, input the contact name');
		form.contact_name.focus();
		return;
	}
	if( form.item_number.value == '' ){
		alert( 'Please, input the items');
		form.item_number.focus();
		return;
	}
	if( form.address.value == '' ){
		alert('Please, input the address' );
		form.address.focus();
		return;
	}
	if( form.city.value == '' ){
		alert( 'Please, input the city' );
		form.city.focus();
		return;
	}
	if( form.state.value == '' ){
		alert( 'Please, input the state' );
		form.state.focus();
		return;
	}
	if( form.zipcode.value == '' ){
		alert( 'Please, input the zipcode' );
		form.zipcode.focus();
		return;
	}
	form.submit();
}
function register(){
	var form = document.registerForm;
	
	if( form.userID.value == '' ){
		alert( 'Please, input the UserID' );
		form.userID.focus();
		return;
	}
	
	if( form.password.value == '' ){
		alert( 'Please, input the password' );
		form.password.focus();
		return;
	}
	
	if( form.rePassword.value == '' ){
		alert( 'Please, input the password to confirm' );
		form.rePassword.focus();
		return;
	}
	if( form.password.value != form.rePassword.value ){
		alert( 'Please, input the password correctly' );
		form.rePassword.focus();
		return;
	}
	
	if( form.company.value == '' ){
		alert( 'Please, input the Company' );
		form.company.focus();
		return;
	}
	
	if( form.contactName.value==''){
		alert( 'Please, input the Name' );
		form.contactName.focus();
		return;
	}
	
	if( form.address.value==''){
		alert( 'Please, input the Address' );
		form.address.focus();
		return;
	}
	
	if( form.city.value==''){
		alert(' Please, input the City' );
		form.address.focus();
		return;
	}
	
	if( form.zipcode.value ==''){
		alert('Please, input the Zipcode');
		form.zipcode.focus();
		return;
	}
	
	if( form.country.value =='' ){
		alert('Please, input the Country' );
		form.country.focus();
		return;
	}
	
	if( form.email.value == ''){
		alert('Please, input the Email' );
		form.email.focus();
		return;
	}
	
	if( form.phone.value == '' ){
		alert('Please, input the telephone' );
		form.phone.focus();
		return;
	}
	
	form.submit();
}
function goNewCollection(){
	location.href="./index.php?PageName=new_collection";
}
function goProducts() {
	location.href="./index.php?PageName=products_list";
}
function goSpecial() {
	location.href="./index.php?PageName=special";
}
function goNewsAndMedia(){
	location.href="./index.php?PageName=news_and_media";
}
function goCatalog() {
	location.href="./index.php?PageName=catalog";
}
function goPolyTips() {
	location.href="./index.php?PageName=poly_tips_poly_cutting_education";
}
function goForms() {
	location.href="./index.php?PageName=forms";
}
function goProductList( collection, page, search, width_from, width_to ){
	location.href="./index.php?PageName=products_list&Collection=" + collection + '&Page=' + page + '&SearchField=' + search + '&WidthFrom=' + width_from + '&WidthTo=' + width_to;
}
function goProductView( collection, pro, page, search, width_from, width_to ){
	location.href="./index.php?PageName=product_view&Collection=" + collection + "&ProductId=" + pro + "&Page=" + page + '&SearchField=' + search + '&WidthFrom=' + width_from + '&WidthTo=' + width_to;
}
function login() {
	form = document.loginForm;
	if( form.userID.value == '' )
	{
		alert( 'Please, input your id' );
		form.userID.focus();
		return;
	}
	if( form.userPASS.value == '' )
	{
		alert( 'Please, input your pass' )
		form.userPASS.focus();
		return;
	}
	form.submit();
}
function addToCart(){
	form = document.cartForm;
	form.submit();
}
function productSearch() {
	form = document.searchForm;
	form.submit();
}
function updateCart( no, value ){
	form = document.cart_mod;
	form.cart_item_no.value = no;
	form.quantity.value = value;
	form.submit();
}
function removeCart( no ){
	form = document.cart_rem;
	form.cart_item_no.value = no;
	form.submit();
}
function requestCatalog(){
	location.href="./index.php?PageName=request_catalog_sample";
}
function requestOrder(){
	location.href="./index.php?PageName=request_order";
}
function submit_findpass(){
	form = document.fp_form;
	if( form.userID.value == '' ){
		alert('Please, enter the user ID' );
		form.userID.focus();
		return;
	}
	if( form.email.value == '' ){
		alert('Please, enter your email');
		form.email.focus();
		return;
	}
	form.submit();
}