/* General */
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*Get Name*/
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;}}}return strReturn;
}

function getURL() {
	var file_name = document.location.href;
	var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
	return file_name.substring(file_name.lastIndexOf("/")+1, file_name.lastIndexOf("."));
}

function getName() {
	var file_name = document.location.href;
    var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
	return file_name.substring(file_name.lastIndexOf("/")+1, file_name.lastIndexOf("_"));
}

function getLan() {
	var file_name = document.location.href;
    var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
	return file_name.substring(file_name.lastIndexOf("_")+1, file_name.lastIndexOf("."));
}
             
/*Windows Title*/
function windows_title(){
document.write("<title>Mini Cooper Bicycle</title>");
}

/*
function menu(){
stm_bm(["menu316b",900,"images/","blank.gif",0,"","",0,0,250,0,1000,1,0,0,"","",0,0,1,2,"default","hand","",1,25],this);
stm_bp("p0",[0,4,0,0,0,0,0,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.60)",6,"",-2,50,0,0,"#999999","#E6EFF9","",3,0,0,"#000000"]);
stm_ai("p0i0",[2,"","menu_home.jpg","menu_home_s.jpg",104,27,0,"index.html","_self","","","","",0,0,0,"","",0,0,0,0,1,"#E6EFF9",1,"#FFD602",1,"","",3,3,0,0,"#E6EFF9","#000000","#000000","#000000","8pt Verdana","8pt Verdana",0,0,"","","","",0,0,0]);
stm_aix("p0i1","p0i0",[2,"","menu_aboutmini.jpg","menu_aboutmini_s.jpg",106,27,0,"aboutmini.html"]);
stm_aix("p0i2","p0i0",[2,"","menu_products.jpg","menu_products_s.jpg",105,27,0,"","_self","","","","",0,0,0,"","",0,0,0,0,1,"",1,""]);
stm_bpx("p1","p0",[1,4,0,0,1,4,5,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.60)",6,"",-2,50,0,0,"#999999","transparent"]);
stm_aix("p1i0","p0i0",[0,"FOLDING BICYCLE","","",-1,-1,0,"folding.html","_self","","","pt.gif","pt_s.gif",5,5,0,"","",0,0,0,0,1,"#ecebeb",0,"#ecebeb",0,"","",3,3,0,0,"#E6EFF9","#000000","#939292","#222323","11px 'Arial','Verdana'","11px 'Arial','Verdana'"]);
stm_aix("p1i1","p1i0",[0,"STANDARD BICYCLE","","",-1,-1,0,"standard.html"]);
stm_aix("p1i2","p1i0",[0,"KID\'S BICYCLE","","",-1,-1,0,"kids.html"]);
stm_aix("p1i3","p1i0",[0,"ACCESSORY","","",-1,-1,0,"accessory.html"]);
stm_ep();
stm_aix("p0i3","p0i0",[2,"","menu_news.jpg","menu_news_s.jpg",106,27,0,"news.html"]);
stm_aix("p0i4","p0i0",[2,"","menu_contact.jpg","menu_contact_s.jpg",105,27,0,"contact.html"]);
stm_ep();
stm_em();
}


function leftmenu(){
document.write("<div style='padding:0 0 0 29px;'>");
document.write("<div><a href='folding.html'><img src='images/cat_folding.jpg' border='0' style='padding:0 0 4px 0;'/></a></div>");
document.write("<div><a href='standard.html'><img src='images/cat_standard.jpg' border='0' style='padding:0 0 4px 0;'/></a></div>");
document.write("<div><a href='kids.html'><img src='images/cat_kids.jpg' border='0' style='padding:0 0 4px 0;'/></a></div>");
document.write("<div><a href='accessory.html'><img src='images/cat_accessory.jpg' border='0' style='padding:0 0 4px 0;'/></a></div>");
document.write("</div>");
}
*/

function LanMenu(pname){
	
	big5_choose="";
	en_choose="";
	gb_choose="";
	
	if(getLan()=="big5")big5_choose="_s";
	if(getLan()=="en")en_choose="_s";
	if(getLan()=="gb")gb_choose="_s";
	
document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td height='71' align='left' valign='top'>");
document.write("<a href='"+getName()+"_big5.html'><img src='images/lan_big5"+big5_choose+".jpg' border='0' style='float:left;'/></a>");
document.write("<a href='"+getName()+"_gb.html'><img src='images/lan_gb"+gb_choose+".jpg' border='0' style='float:left;' /></a>");
document.write("<a href='"+getName()+"_en.html'><img src='images/lan_en"+en_choose+".jpg' border='0' style='float:left;' /></a>");
document.write("<a name='top' id='top'></a>");
document.write("</td><td width='218' align='left' valign='top'><a href='index.html'><img src='images/link.jpg' border='0' style='padding:32px 0 0 0;'/></a></td>");
document.write("</tr></table>");
document.write("<div style='padding:0 0 0 160px;height:263px;'><script>menu('"+pname+"');</script></div>");
}

function footer(){
document.write("<div><img src='images/footer.jpg' border='0' usemap='#Map' /></div>");
document.write("<map name='Map' id='Map'>");
document.write("<area shape='rect' coords='548,9,679,30' href='index.html' />");
document.write("<area shape='rect' coords='865,11,980,30' href='http://www.communilink.net' target='_blank' />");
document.write("</map>");
}

/* Product Img */
function pimgL(pname, pno){
	document.write("<div align='right' style='border-bottom: 1px solid #3b3b3b;margin:15px 0 15px 0;clear:both;'><a href='#top'><img src='images/btn_top.jpg' border='0' /></a></div>");
    document.write("<div style='float:right;text-align:center;'>");
	document.write("<table cellspacing='0' cellpadding='0' width='0' border='0' style='margin:0 0 4px 0;'>");
	document.write("<tbody><tr>");
	document.write("<td width='25'><img height='24' src='images/center_1.gif' width='25' /></td>");
	document.write("<td background='images/box_1.gif'></td>");
	document.write("<td width='25'><img height='24' src='images/center_2.gif' width='25' /></td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td background='images/box_4.gif'></td>");
	document.write("<td bgcolor='#f3f3f3'><img src='products/"+pname+"_1.jpg' name='"+pname+"_0' border='0' /></td>");
	document.write("<td background='images/box_2.gif'></td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td><img height='24' src='images/center_3.gif' width='25' /></td>");
	document.write("<td background='images/box_3.gif'></td>");
	document.write("<td><img height='24' src='images/center_4.gif' width='25' /></td>");
	document.write("</tr>");
	document.write("</tbody>");
	document.write("</table>");
}

function loopfunction(pname, pno){
pimgL(pname);
if(pno=="1"){document.write("</div>");
} else {
for (i=1; i<=img_no;i++){pimg(pname,i);}
document.write("</div>");
}}


function pimg(pname, pno){
document.write("<img src='products/"+pname+"_thum_"+pno+".jpg' border='0' name='"+pname+"_"+pno+"' style='padding:0 1px 0 1px;'/>");
eval("document."+pname+"_"+pno).onmouseover=img_over
function img_over()  {eval("document."+pname+"_0").src='products/'+pname+'_'+pno+'.jpg'
}
}


function goTop(){
document.write("<div align='right' style='border-bottom: 1px solid #3b3b3b;margin:15px 0 15px 0;clear:both;'><a href='#top'><img src='images/btn_top.jpg' border='0' /></a></div>");
}

//for (i=1; i<=pno;i++){
//document.write("<img src='products/"+pname+"_thum_"+i+".jpg' border='0' name='"+pname+"_"+i+"' style='padding:0 1px 0 1px;'/>");
//}


//document.fold_fdb166_1.onmouseover=fold_fdb166_1
//document.fold_fdb166_2.onmouseover=fold_fdb166_2
//document.fold_fdb166_3.onmouseover=fold_fdb166_3

//function fold_fdb166_1()  {document.fold_fdb166_0.src='products/'+pname+'_1.jpg'}
//function fold_fdb166_2()  {document.fold_fdb166_0.src='products/'+pname+'_2.jpg'}
//function fold_fdb166_3()  {document.fold_fdb166_0.src='products/'+pname+'_3.jpg'}




/*
document.fold_fdb166_1.onmouseover=fold_fdb166_1
document.fold_fdb166_2.onmouseover=fold_fdb166_2
document.fold_fdb166_3.onmouseover=fold_fdb166_3

function fold_fdb166_1()  {document.fold_fdb166_0.src='products/fold_fdb166_1.jpg'}
function fold_fdb166_2()  {document.fold_fdb166_0.src='products/fold_fdb166_2.jpg'}
function fold_fdb166_3()  {document.fold_fdb166_0.src='products/fold_fdb166_3.jpg'}
*/





/*
function footer(){
document.write("<div><img src='images/footer2.jpg' border='0' usemap='#footer' /></div>");
document.write("<map name='footer' id='footer'>");
document.write("<area shape='rect' coords='749,12,830,32' href='http://www.communilink.net' target='_blank' />");
document.write("<area shape='rect' coords='246,12,581,33' href='http://sme-dsa.org' /></map>");
}


function lan(){
if(getLan()=="en"){document.write("<script language=JavaScript src=js/en.js></script>"); 
}else{document.write("<script language=JavaScript src=js/big5.js></script>");}
}


function header(v,lis){
document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
document.write("<tr><td width='144'><a href='index.htm'><img src='images/logo.jpg' width='144' height='90' border='0'/></a></td>");
document.write("<td width='786'>");

AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '786',
'height', '90',
'src', 'flash/banner',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'banner',
'bgcolor', '#ffffff',
'name', 'banner',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'flash/banner',
'salign', ''
);
       
document.write("</td><td width='65'><img src='images/lan.jpg' width='65' height='90' border='0' usemap='#Lan'/></td></tr></table>");
document.write("<map name='Lan' id='Lan'>");


if (v==undefined && lis==undefined) {
document.write("<area shape='rect' coords='-6,-1,26,29' href='"+getName()+"_en.htm' />");
document.write("<area shape='rect' coords='33,0,63,30' href='"+getName()+"_big5.htm' /></map>");	
}else{document.write("<area shape='rect' coords='-6,-1,26,29' href='"+getName()+"_en.htm?v="+v+"&lis="+lis+"' />");
document.write("<area shape='rect' coords='33,0,63,30' href='"+getName()+"_big5.htm?v="+v+"&lis="+lis+"' /></map>");
}
}

function invideo(){
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', '390',
			'height', '340',
			'src', 'video/video',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'video',
			'bgcolor', '#ffffff',
			'name', 'video',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'video/video',
			'salign', '',
			'wmode','transparent',
			'FlashVars','video_path=dsa_'+v+'.flv'
			);
}		

function previous_info(){
if (v=="40") {document.write("<p class='subtitle_blue'>40th DSA - Video on Presentation Ceremony</p>");
invideo()}
else if (lis=="40") {document.write("<p class='subtitle_blue'>40th DSA - List of awardees</p>");
document.write("<script>list_40();</script>");}

if (v=="39") {document.write("<p class='subtitle_blue'>39th DSA - Video on Presentation Ceremony</p>");
invideo()}
else if (lis=="39") {document.write("<p class='subtitle_blue'>39th DSA - List of awardees</p>");
document.write("<script>list_39();</script>");}

else if (v=="38") {document.write("<p class='subtitle_blue'>38th DSA - Video on Presentation Ceremony</p>");
invideo()}
else if (lis=="38") {document.write("<p class='subtitle_blue'>38th DSA - List of awardees</p>");
document.write("<script>list_38();</script>");}

else if (v=="37") {document.write("<p class='subtitle_blue'>37th DSA - Video on Presentation Ceremony</p>");
invideo()}
else if (lis=="37") {document.write("<p class='subtitle_blue'>37th DSA - List of awardees</p>");
document.write("<script>list_37();</script>");}
}
*/
