function setCursor() {
         if(document.SEARCH) {
	 document.SEARCH.Key.focus();
	 }
	 }

var flag=false; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
image.width=250;

}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//************************************************

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}



function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}

function frm_create()
{
if(checkspace(document.frmCreate.txtEmail.value)) {
alert("please input your Email address.");
document.frmCreate.txtEmail.focus();
return false;
}
if(document.frmCreate.txtEmail.value.length!=0)
{
if (document.frmCreate.txtEmail.value.charAt(0)=="." ||
document.frmCreate.txtEmail.value.charAt(0)=="@"||
document.frmCreate.txtEmail.value.indexOf('@', 0) == -1 ||
document.frmCreate.txtEmail.value.indexOf('.', 0) == -1 ||
document.frmCreate.txtEmail.value.lastIndexOf("@")==document.frmCreate.txtEmail.value.length-1 ||
document.frmCreate.txtEmail.value.lastIndexOf(".")==document.frmCreate.txtEmail.value.length-1)
{
alert("Email address is invalid.");
document.frmCreate.txtEmail.focus();
return false;
}
}
if(checkspace(document.frmCreate.txtPassword.value)) {
document.frmCreate.txtPassword.focus();
alert("Please input password, Thanks!");
return false;
}
if(checkspace(document.frmCreate.txtPassword2.value)) {
document.frmCreate.txtPassword2.focus();
alert("Please retype your password, Thanks!");
return false;
}
if(document.frmCreate.txtPassword.value!=document.frmCreate.txtPassword2.value){
document.frmCreate.txtPassword2.focus();
alert("You did not retype your password correctly. Please try again.");
return false;
}
if(checkspace(document.frmCreate.fname.value)) {
document.frmCreate.fname.focus();
alert("Please input your First Name, Thanks!");
return false;
}
if(checkspace(document.frmCreate.lname.value)) {
document.frmCreate.lname.focus();
alert("Please input your Last Name, Thanks!");
return false;
}
if(checkspace(document.frmCreate.country.value)) {
document.frmCreate.country.focus();
alert("Please input your Country, Thanks!");
return false;
}
}

function frm_login()
{
if(checkspace(document.frmLogin.txtEmail.value)) {
alert("please input your Email address.");
document.frmLogin.txtEmail.focus();
return false;
}
if(document.frmLogin.txtEmail.value.length!=0)
{
if (document.frmLogin.txtEmail.value.charAt(0)=="." ||
document.frmLogin.txtEmail.value.charAt(0)=="@"||
document.frmLogin.txtEmail.value.indexOf('@', 0) == -1 ||
document.frmLogin.txtEmail.value.indexOf('.', 0) == -1 ||
document.frmLogin.txtEmail.value.lastIndexOf("@")==document.frmLogin.txtEmail.value.length-1 ||
document.frmLogin.txtEmail.value.lastIndexOf(".")==document.frmLogin.txtEmail.value.length-1)
{
alert("Email address is invalid.");
document.frmLogin.txtEmail.focus();
return false;
}
}
if(checkspace(document.frmLogin.txtPassword.value)) {
document.frmLogin.txtPassword.focus();
alert("Please input password, Thanks!");
return false;
}
}

function frm_email()
{
if(checkspace(document.form_email.name.value)) {
document.form_email.name.focus();
alert("Sorry, Please leave your name.");
return false;
}
if(checkspace(document.form_email.email.value)) {
document.form_email.email.focus();
alert("Please leave your email,thank you!");
return false;
}
if(document.form_email.email.value.length!=0)
{
if (document.form_email.email.value.charAt(0)=="." ||
document.form_email.email.value.charAt(0)=="@"||
document.form_email.email.value.indexOf('@', 0) == -1 ||
document.form_email.email.value.indexOf('.', 0) == -1 ||
document.form_email.email.value.lastIndexOf("@")==document.form_email.email.value.length-1 ||
document.form_email.email.value.lastIndexOf(".")==document.form_email.email.value.length-1)
{
alert("Email format Error!");
document.form_email.email.focus();
return false;
}
}
if(checkspace(document.form_email.address.value)) {
document.form_email.address.focus();
alert("Sorry, Please leave your address.");
return false;
}
if(checkspace(document.form_email.content.value)) {
document.form_email.content.focus();
alert("Please input your message, thank you!");
return false;
}
}

function frm_shipping()
{
if(checkspace(document.frm_shippinginfo.fullname.value)) {
document.frm_shippinginfo.fullname.focus();
alert("Sorry, Please leave your full name.");
return false;
}
if(checkspace(document.frm_shippinginfo.shipping_add.value)) {
document.frm_shippinginfo.shipping_add.focus();
alert("Sorry, Please leave your address.");
return false;
}
if(checkspace(document.frm_shippinginfo.post_code.value)) {
document.frm_shippinginfo.post_code.focus();
alert("Sorry, Please leave your post code.");
return false;
}
if(checkspace(document.frm_shippinginfo.tele.value)) {
document.frm_shippinginfo.tele.focus();
alert("Sorry, Please leave your telephone.");
return false;
}
if(checkspace(document.frm_shippinginfo.email.value)) {
document.frm_shippinginfo.email.focus();
alert("Please leave your email,thank you!");
return false;
}
if(document.frm_shippinginfo.email.value.length!=0)
{
if (document.frm_shippinginfo.email.value.charAt(0)=="." ||
document.frm_shippinginfo.email.value.charAt(0)=="@"||
document.frm_shippinginfo.email.value.indexOf('@', 0) == -1 ||
document.frm_shippinginfo.email.value.indexOf('.', 0) == -1 ||
document.frm_shippinginfo.email.value.lastIndexOf("@")==document.frm_shippinginfo.email.value.length-1 ||
document.frm_shippinginfo.email.value.lastIndexOf(".")==document.frm_shippinginfo.email.value.length-1)
{
alert("Email format Error!");
document.frm_shippinginfo.email.focus();
return false;
}
}

}