//URL////////////////////////////////////////////////////////////////////
/*function getURL() {
	var file_name = document.location.href;
	var first_search = file_name.substring(file_name.lastIndexOf("/")+1, file_name.lastIndexOf("."));
	if (first_search==""){
		return "index"
		}
	else{
		return first_search
		}
}*/

//language version////////////////////////////////////////////////////////////////////
function getLAN() {
	var file_name = document.location.href;
	var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
	var first_search = file_name.substring(file_name.lastIndexOf("_")+1, file_name.lastIndexOf("."));
	if (first_search!="big5"){
	return "_en"}
	else{
	return "_big5"}	
}

var LAN = getLAN();
//alert(LAN);

function getURL(lan) {
	var file_name = document.location.href;
	var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
	var first_search = file_name.substring(file_name.lastIndexOf("/")+1, file_name.lastIndexOf("."));
	if (first_search!="index"){
	if (lan==""){ 
			return first_search
		}else{
			var second_search =first_search.substring(0, first_search.lastIndexOf("_"));
			return second_search
		}
	}
	else{
	return "index"}
}
var URL = getURL(getLAN());
//alert(URL);


//layer////////////////////////////////////////////////////////////
function header(page){
document.write("<table width='995' border='0' cellpadding='0' cellspacing='0' align=center>")
document.write("<tr><td><img src='images/corner.jpg'>")

menu()

document.write("</script><img src='images/border.jpg'></td></tr>")
document.write("<tr><td valign='top' style='background-image:url(images/bg.jpg); background-repeat:no-repeat'>")

document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' background='images/bg_"+page+".jpg'>")
document.write("  <tr>")
document.write("    <td valign='top'>")
document.write(" <a href=index.html>")
document.write("   <img src='images/logo.jpg' alt='' align=left border=0></a>")
}


function menu(){
document.write("<a href='home.htm'><img src=images/menu_home.jpg name=home_p border=0></a>");
document.home_p.onmouseover=home_p_over
document.home_p.onmouseout=home_p_out
function home_p_out( ){ document.home_p.src='images/menu_home.jpg'}
function home_p_over( ){ document.home_p.src='images/menu_home-over.jpg'}


document.write("<a href='product.html'><img src=images/menu_product.jpg name=product_p border=0></a>");
document.product_p.onmouseover=product_p_over
document.product_p.onmouseout=product_p_out
function product_p_out( ){ document.product_p.src='images/menu_product.jpg'}
function product_p_over( ){ document.product_p.src='images/menu_product-over.jpg'}


document.write("<a href='other.html'><img src=images/menu_staff.jpg name=staff_p border=0></a>");
document.staff_p.onmouseover=staff_p_over
document.staff_p.onmouseout=staff_p_out
function staff_p_out( ){ document.staff_p.src='images/menu_staff.jpg'}
function staff_p_over( ){ document.staff_p.src='images/menu_staff-over.jpg'}


document.write("<a href='contact.html'><img src=images/menu_contact.jpg name=contact_p border=0></a>");
document.contact_p.onmouseover=contact_p_over
document.contact_p.onmouseout=contact_p_out
function contact_p_out( ){ document.contact_p.src='images/menu_contact.jpg'}
function contact_p_over( ){ document.contact_p.src='images/menu_contact-over.jpg'}
}

function footer(){
document.write("</td>");
document.write("  </tr>");
document.write("  <tr>");
document.write("    <td valign=top>")
document.write("<map name='Map'>");
document.write("  <area shape='rect' coords='153,59,239,82' href='http://www.communilink.net' target='_blank'>");
document.write("</map>");
document.write("<img src='images/footer.gif' border='0' usemap='#Map'>");
document.write("</td>");
document.write("  </tr>");
document.write("</table>");
document.write("</td></tr></table>");
}

function windows_title(){
document.write("<title>Wing Wah Embroidery Co.</title>");
}