﻿function goFind(){
var cFtxt=document.getElementById("skey");
	if(cFtxt.value.length<2){	
		return false;
	}else{
		return true;
	}
	
}
function goLocation(){
var cFtxt=document.getElementById("dploc");
document.location='Distribution.asp?locid='+cFtxt.options[cFtxt.selectedIndex].value;
}
function sendmessage() {
    var loc = document.getElementById("loc");
    if (loc.options[loc.selectedIndex].value=="-1") {
        alert("Please select your country or region.");
        loc.focus();
        return false;
    }
    var fname = document.getElementById("txt_fname");
    if (fname.value.length < 1) {
        alert("Please fill the first name field.");
        fname.focus();
        return false;
    }
    var lname = document.getElementById("txt_lname");
    if (lname.value.length < 1) {
        alert("Please fill the last name field.");
        lname.focus();
        return false;
    }
    var m = document.getElementById("txt_mail");
    if (m.value.length < 1) {
        alert("Please fill the email address field.");
        m.focus();
        return false;
    }
    var msg = document.getElementById("txt_msg");
    if (msg.value.length < 1) {
        alert("Please fill the message field.");
        msg.focus();
        return false;
    }
    var fm = document.getElementById("fm");
    var at = document.getElementById("at");
    at.value = "addnew";
    fm.submit();
}

function sendtechmessage() {
    var loc = document.getElementById("loc");
    var pname = document.getElementById("pname");
    var psn = document.getElementById("psn");
    if (loc.options[loc.selectedIndex].value == "-1") {
        alert("Please select your country or region.");
        loc.focus();
        return false;
    } if (pname.options[pname.selectedIndex].value == "-1") {
        alert("Please select a product.");
        psn.focus();
        return false;
    }
    if (psn.value.length < 3) {
        alert("Please fill the product sn.");
        psn.focus();
        return false;
    }
    var fname = document.getElementById("txt_fname");
    if (fname.value.length < 1) {
        alert("Please fill the first name field.");
        fname.focus();
        return false;
    }
    var lname = document.getElementById("txt_lname");
    if (lname.value.length < 1) {
        alert("Please fill the last name field.");
        lname.focus();
        return false;
    }
    var m = document.getElementById("txt_mail");
    if (m.value.length < 1) {
        alert("Please fill the email address field.");
        m.focus();
        return false;
    }
    var msg = document.getElementById("txt_msg");
    if (msg.value.length < 1) {
        alert("Please fill the message field.");
        msg.focus();
        return false;
    }
    var fm = document.getElementById("fm");
    var at = document.getElementById("at");
    at.value = "addnew";
    fm.submit();
}
function docbottom(urlpath){
document.write("<div id='bottom'><a href='"+urlpath+"sitemap.htm'>Site Map</a> | <a href='"+urlpath+"company.htm'>Company</a> | <a title='Xindak Product Awards' href='"+urlpath+"awards.htm'>Awards</a> | <a title='Contact Xindak' href='"+urlpath+"contact.htm'>Contact Us</a><br>&copy; 2010 Chengdu Xindak Electronic Co.,LTD.</div>");
}

function main_toolbar(urlpath){
    document.write("<div class='toolbar'><a href='products.asp'>Products</a>|<a href='news.asp'>News</a>|<a href='review.asp'>Review</a>|<a href='contact.htm'>Contact</a>|<a href='buy.htm' title='How to purchase Xindak Product'>Where to Buy</a>|<a href='company.htm' title='About Xindak company'>Company</a></div>");
}

function login(){

var act=document.getElementById("act");
var cpwd=document.getElementById("tpwd");
var cuid=document.getElementById("tuid");
act.value="login";

return true;
}
