﻿function GETOBJ(OBJID){if(document.getElementById && document.getElementById(OBJID)){return document.getElementById(OBJID);}else if(document.all && document.all(OBJID)){return document.all(OBJID);}else if(document.layers && document.layers[OBJID]){return document.layers[OBJID];}else{return false;}}
//---------------------------------------
function AutoSmallImg(ImgD,W,H){var image=new Image();var iwidth = W;var iheight = H;image.src=ImgD.src;if(image.width>0 && image.height>0){if(image.width/image.height>= iwidth/iheight){if(image.width>iwidth){ImgD.width=iwidth;ImgD.height=(image.height*iwidth)/image.width;}else{ImgD.width=image.width;ImgD.height=image.height;}}else{if(image.height>iheight){ImgD.height=iheight;ImgD.width=(image.width*iheight)/image.height;}else{ImgD.width=image.width;ImgD.height=image.height;}}}} 
//---------------------------------------
function chk1(){
	var obj1=GETOBJ("kws");
	if (obj1.value==""){
		alert("please enter a keyword...");
		obj1.focus();
		return false;
	}
}
//---------------------------------------
function show1(src1){
	var obj1=GETOBJ("img_1");
	obj1.innerHTML='<img src="'+src1+'" onload="AutoSmallImg(this,530,500)" />'
}
//---------------------------------------
function chk2(){
	var obj1=GETOBJ("form_2");
	var obj2=GETOBJ("form_4");
	var obj3=GETOBJ("form_5");
	var obj4=GETOBJ("form_6");
	var obj5=GETOBJ("form_7");
	var obj6=GETOBJ("form_8");
	var obj7=GETOBJ("form_9");
	if (obj1.value==""){
		alert("please enter value of Quantity");
		obj1.focus();
		return false;
	}else if (obj2.value==""){
		alert("please enter value of Description");
		obj2.focus();
		return false;
	}else if (obj3.value==""){
		alert("please enter value of Your Name");
		obj3.focus();
		return false;
	}else if (obj4.value==""){
		alert("please enter value of Email");
		obj4.focus();
		return false;
	}else if (obj6.value==""){
		alert("please enter value of Country");
		obj6.focus();
		return false;
	}else if (obj7.value==""){
		alert("please enter value of Address");
		obj7.focus();
		return false;
	}else{
		document.form1.action="/inq.asp";
		document.form1.submit();
	}
}
//---------------------------------------
function chk3(){
	var obj1=GETOBJ("form_1");
	var obj2=GETOBJ("form_2");
	var obj3=GETOBJ("form_3");
	var obj4=GETOBJ("form_4");
	var obj5=GETOBJ("form_8");
	if (obj1.value==""){
		alert("please enter Your Name");
		obj1.focus();
		return false;
	}else if (obj2.value==""){
		alert("please enter value of Telephone");
		obj2.focus();
		return false;
	}else if (obj3.value==""){
		alert("please enter value of Address");
		obj3.focus();
		return false;
	}else if (obj4.value==""){
		alert("please enter value of Email");
		obj4.focus();
		return false;
	}else if (obj5.value==""){
		alert("please enter Message Content");
		obj5.focus();
		return false;
	}else{
		document.form1.action="/feedbacks.asp";
		document.form1.submit();
	}
}