﻿<!-- Original:  Rich Galichon (rich@galichon.net) -->
<!-- Web Site:  http://www.galichon.net -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
//function banner(imgSource,url,alt,chance) {
function banner(imgSource,url,alt,type,chance) {
this.imgSource = imgSource;
this.url = url;
this.alt = alt;
this.type = type;
this.chance = chance;
}
banners_1 = new Array();
banners_1[0] = new banner("/image/ad/ad_ka.gif",
                        "http://www.kasail.com/ target='_blank'",
                        "The KA Sail",
                        "gif",
                        0);
banners_1[1] = new banner("http://www.windfanshk.com/image/ad/ad_hau.swf",
                        "mailto:wind3804@yahoo.com.hk target='_self'",
                        "你需要一個廣告?",
                        "flash",
                        0);
banners_1[2] = new banner("/image/ad/ad_simmer.gif",
                        "http://www.simmerstyle.eu target='_blank'",
                        "Simmer Sails",
                        "gif",
                        100);
///////////////////////////////////////////////////
// banners_1[x] = new banner(<banner source image>,                                           //                         <url to link to when the banner is clicked>,                     //                         <alt>                                                            //                         <the chance this banner has in which to be randomly selected>);  
// To increase the chance of a banner being randomly selected, increase it's corresponding  // 'chance' property relative to the other banners.                                         
///////////////////////////////////////////////////
sum_of_all_chances = 0;
for (i = 0; i < banners_1.length; i++) {
sum_of_all_chances += banners_1[i].chance;
}
function randomBanner_1() {
chance_limit = 0; randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
for (i = 0; i < banners_1.length; i++) {
chance_limit += banners_1[i].chance;
if (randomly_selected_chance <= chance_limit) {

if (banners_1[i].type == "flash") {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
document.write(' ID=banner WIDTH=468 HEIGHT=60>');
document.write(' <PARAM NAME=movie VALUE=' + banners_1[i].imgSource + '?clickTAG='+ banners_1[i].url + '> ');
document.write(' <PARAM NAME=quality VALUE=autohigh> ');
document.write(' <PARAM NAME=wmode VALUE=transparent> ');
document.write('');
document.write('<EMBED SRC=' + banners_1[i].imgSource + '?clickTAG='+ banners_1[i].url +' ');
document.write(' WIDTH=468 HEIGHT=60');
document.write(' QUALITY=autohigh');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT>');
} else {
document.write("<A HREF=" + banners_1[i].url + "><IMG SRC='" + banners_1[i].imgSource + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + banners_1[i].alt + "'></A>");
}


return banners_1[i];
break;
      }
   }
}
//  End -->
document.write ( 
'<link href="/style/shopstyle.css" rel="stylesheet" type="text/css">'
);
function popWin(URL,WIDTH,HEIGHT,TOP,LEFT) {
 search = window.open(URL, '', 'width='+WIDTH+',height='+HEIGHT+',top='+TOP+',left='+LEFT);
 if (search != null) {
  if (search.opener == null)
   search.opener = self;
 }
}

<!--
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Travis Beckham :: http://www.squidfingers.com | http://www.podlob.com
version date: 06/02/03 :: If want to use this code, feel free to do so,
but please leave this message intact. (Travis Beckham) */

// Node Functions

if(!window.Node){
  var Node = {ELEMENT_NODE : 1, TEXT_NODE : 3};
}

function checkNode(node, filter){
  return (filter == null || node.nodeType == Node[filter] || node.nodeName.toUpperCase() == filter.toUpperCase());
}

function getChildren(node, filter){
  var result = new Array();
  var children = node.childNodes;
  for(var i = 0; i < children.length; i++){
    if(checkNode(children[i], filter)) result[result.length] = children[i];
  }
  return result;
}

function getChildrenByElement(node){
  return getChildren(node, "ELEMENT_NODE");
}

function getFirstChild(node, filter){
  var child;
  var children = node.childNodes;
  for(var i = 0; i < children.length; i++){
    child = children[i];
    if(checkNode(child, filter)) return child;
  }
  return null;
}

function getFirstChildByText(node){
  return getFirstChild(node, "TEXT_NODE");
}

function getNextSibling(node, filter){
  for(var sibling = node.nextSibling; sibling != null; sibling = sibling.nextSibling){
    if(checkNode(sibling, filter)) return sibling;
  }
  return null;
}
function getNextSiblingByElement(node){
        return getNextSibling(node, "ELEMENT_NODE");
}

// Menu Functions & Properties

var activeMenu = null;

function showMenu() {
  if(activeMenu){
    activeMenu.className = "";
    getNextSiblingByElement(activeMenu).style.display = "none";
  }
  if(this == activeMenu){
    activeMenu = null;
  } else {
    this.className = "active";
    getNextSiblingByElement(this).style.display = "block";
    activeMenu = this;
  }
  return false;
}

function initMenu(){
  var menus, menu, text, a, i;
  menus = getChildrenByElement(document.getElementById("menu"));
  for(i = 0; i < menus.length; i++){
    menu = menus[i];
    text = getFirstChildByText(menu);
    a = document.createElement("a");
    menu.replaceChild(a, text);
    a.appendChild(text);
    a.href = "#";
    a.onclick = showMenu;
    a.onfocus = function(){this.blur()};
  }
}

//-->