//This is Begining of Vertical Logos
//This is Ending of Vertical Logos


//This is Begining of banner ads
//<a href="javascript:changepage()"><img src="BannerAd-0.gif" alt="Banner Advertisement" border="0" hspace="0" name="bannerad" WIDTH="466" HEIGHT="58"></a>
var        logomax = 24; 
   

function loadpage() {
 //   document.write( "test" ) ; 
//    vSlider();
    browver= parseInt(navigator.appVersion);
    browtype = navigator.appName;
    browsertype = "old";
    if (browtype == "Netscape" && !(browver < 3)) {
        browsertype = "new"; 
    }
    if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
        browsertype = "new";
    }
    if (browsertype == "new") {
        thetimer = setTimeout("changeimage()", 1000);
        banneradcode = 0;
        listofimages = new Array(7); //Number of ADs
        listofimages[0] = new Image(468,58);
        listofimages[0].src = "img/BannerAd-0.jpg";
        listofimages[1] = new Image(468,58);
        listofimages[1].src = "img/BannerAd-1.jpg";
        listofimages[2] = new Image(468,58);
        listofimages[2].src = "img/BannerAd-2.jpg";
        listofimages[3] = new Image(468,58);
        listofimages[3].src = "img/BannerAd-3.jpg";//Number of ADs
        listofimages[4] = new Image(468,58);
        listofimages[4].src = "img/BannerAd-4.jpg" ;//Number of ADs
        listofimages[5] = new Image(468,58);
        listofimages[5].src = "img/BannerAd-5.jpg" ;//Number of ADs
        listofimages[6] = new Image(468,58);
        listofimages[6].src = "img/BannerAd-6.jpg" ;//Number of ADs

        logotimer = setTimeout("changelogo()", 1000);
        logocode = 0;
        logoimages = new Array(logomax); //Number of ADs
        logoimages[0] = new Image(160,25);
        logoimages[0].src = "img/asus.jpg";
        logoimages[0].title = "www.asus.com";
        logoimages[1] = new Image(80,25);
        logoimages[1].src = "img/intel.jpg";
        logoimages[1].title = "www.intel.com";
        logoimages[2] = new Image(80,25);
        logoimages[2].src = "img/lg_logo.jpg";
        logoimages[2].title = "www.LG.com";
        logoimages[3] = new Image(120,25);
        logoimages[3].src = "img/toshiba.jpg";
        logoimages[3].title = "www.toshiba.com";
        logoimages[4] = new Image(168,25);
        logoimages[4].src = "img/ecs_logo.jpg";
        logoimages[4].title = "www.ecs.com";
        logoimages[5] = new Image(160,25);
        logoimages[5].src = "img/supermicro.jpg";
        logoimages[5].title = "www.supermicro.com";
        logoimages[6] = new Image(160,25);
        logoimages[6].src = "img/samsung_logo.jpg";
        logoimages[6].title = "www.samsung.com";
        logoimages[7] = new Image(168,58);
        logoimages[7].src = "img/wd_logo.jpg";
        logoimages[7].title = "www.wd.com";
        logoimages[8] = new Image(80,25);
        logoimages[8].src = "img/apc_logo.jpg";
        logoimages[8].title = "www.apc.com";
        logoimages[9] = new Image(168,25);
        logoimages[9].src = "img/gigabyte_logo.jpg";
        logoimages[9].title = "www.gigabyte.com";
        logoimages[10] = new Image(168,25);
        logoimages[10].src = "img/optiarc.jpg";
        logoimages[10].title = "www.optiarc.com";
        logoimages[11] = new Image(168,25);
        logoimages[11].src = "img/netgear_logo.jpg";
        logoimages[11].title = "www.netgear.com";
        logoimages[12] = new Image(168,25);
        logoimages[12].src = "img/trendnet.gif";
        logoimages[12].title = "www.trendnet.com";
        logoimages[13] = new Image(168,25);
        logoimages[13].src = "img/seagate_logo.gif";
        logoimages[13].title = "www.seagate.com";
        logoimages[14] = new Image(120,25);
        logoimages[14].src = "img/belkin_logo.jpg";
        logoimages[14].title = "www.belkin.com";
        logoimages[15] = new Image(168,25);
        logoimages[15].src = "img/hp.jpg";
        logoimages[15].title = "www.hp.com";
        logoimages[16] = new Image(81,45);
        logoimages[16].src = "img/amd_logo.jpg";
        logoimages[16].title = "www.amd.com";
        logoimages[17] = new Image(90,35);
        logoimages[17].src = "img/acer.gif";
        logoimages[17].title = "www.acer.com";
        logoimages[18] = new Image(168,25);
        logoimages[18].src = "img/msi_logo.jpg";
        logoimages[18].title = "www.msi.com";
        logoimages[19] = new Image(160,25);
        logoimages[19].src = "img/imicro.jpg";
        logoimages[19].title = "www.imicro.com";
        logoimages[20] = new Image(120,25);
        logoimages[20].src = "img/coolmax_logo.gif";
        logoimages[20].title = "www.coolmax.com";
        logoimages[21] = new Image(89,39);
        logoimages[21].src = "img/smclogo.jpg";
        logoimages[21].title = "www.SMC.com";
        logoimages[22] = new Image(80,25);
        logoimages[22].src = "img/nvidia_logo.jpg";
        logoimages[22].title = "www.nvidia.com";
        logoimages[23] = new Image(120,25);
        logoimages[23].src = "img/logitech_logo.jpg";
        logoimages[23].title = "www.logitech.com";
    }
//    InitSlider1()
}
function changelogo(){
    if (browsertype == "new") {
        logocode = logocode + 1;
        if (logocode == logomax ) { //Number of ADs
            logocode = 0;
        }
//        logosource = "img/BannerAd-" + banneradcode + ".jpg";
        window.document.logo1.src = logoimages[logocode].src;
        window.document.logo2.src = logoimages[(logocode + 1) % logomax].src;
        window.document.logo3.src = logoimages[(logocode + 2) % logomax].src;
        window.document.logo4.src = logoimages[(logocode + 3) % logomax].src;
        window.document.logo5.src = logoimages[(logocode + 4) % logomax].src;
        window.document.logo6.src = logoimages[(logocode + 5) % logomax].src;
        window.document.logo7.src = logoimages[(logocode + 6) % logomax].src;
        window.document.logo8.src = logoimages[(logocode + 7) % logomax].src;
        window.document.logo9.src = logoimages[(logocode + 8) % logomax].src;
        window.document.logo10.src = logoimages[(logocode + 9) % logomax].src;
        window.document.logo11.src = logoimages[(logocode + 10) % logomax].src;
        logotimer = setTimeout("changelogo()", 3000);
    }
    else if (browsertype == "old") {
    }
}
function changeimage(){
    if (browsertype == "new") {
        banneradcode = banneradcode + 1;
        if (banneradcode == "7") { //Number of ADs
            banneradcode = 0;
        }
        imagesource = "img/BannerAd-" + banneradcode + ".jpg";
        window.document.bannerad.src = imagesource;
        thetimer = setTimeout("changeimage()", 7000);
    }
    else if (browsertype == "old") {
    }
}
//function changepage() {
function setit(ob) {
//   if (browsertype == "new") {
//        alert( "this is alert " + ob + " alert " + ob.img );
//  }
}
function gologo(object1) {
   if (browsertype == "new") {
 //       var iname = this.src;
 //       alert( "this is alert " + object1.href + " alert " + object1.img );
//        for ( var i = 0; i < 24; i++ ) (
//            if logoimages[i].src == iname {
//                location = logoimages[i].title;
//                  break;
//            }
//        }
//      location = "http://" + logoimages[1].title;
//    }
 //   else if (browsertype == "old") {
      location = "http://www.7qpc.com/default.asp";
    }
}
function goAd() {
    if (browsertype == "new") {
      if (banneradcode == 0) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 1) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 2) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 3) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 4) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 5) {
        newlocation = "http://www.7qpc.com/default.asp";
        }
      else if (banneradcode == 6) {
        newlocation = "http://www.7qpc.com/default.asp";
        }  //Number of ADs
      location = newlocation
    }
    else if (browsertype == "old") {
      location = "http://www.7qpc.com/default.asp";
    }
}
//You need to modify the <BODY> HTML tag of the page so that when the page is loaded, it executes the loadpage function. Do this by adding the onload tag, as shown below: 
//<body bgcolor="#000080" onload="loadpage()">

//How the script works:

//When the web page is first loaded into the web browser, it runs the function loadpage. This is the first function in the script shown above. The first part of this function is a fairly standard browser detection routine. This sets a variable of browsertype to be "old" by default. However, in browsers that can support all of the JavaScript functions needed to run the script (Netscape 3 & 4 and Internet Explorer 4), it sets the browsertype to "new". Throughout the rest of the script you will see that certain functions will only work in browsertype is set to "new".

//The loadpage function sets a timer (called "thetimer") for 5000 milliseconds (i.e. 5 seconds). When this timer reaches zero, it then runs the changeimage function (the use of which is described further on). Don't forget that the timer can be altered to show a the next image at a longer time interval - important if you don't want to keep distracting the person viewing the web page.

//The loadpage function also sets up a new array called listofimages. This array contains the filenames of the different images that will be loaded. In this particular script, the array is initialized using a slightly different procedure to normal; it creates each item in the image as a new image, then points to the image source. This is important, because it ensures that the browser loads all the image files in the banner at the same time as it loads the page from the server. This avoids subsequent delays when the next image in the sequence needs to be displayed, and is particularly important for those people viewing your site over a slow Internet link. If you want to use the script on your own pages, you will have to change the filenames (making sure the path to the images is also correct - in this example they are named BannerAd-3.gif to BannerAd-3.gif, respectively).

//Finally, the loadpage function creates a variable called banneradcode. This variable is used to cycle through the different images to be shown. The initial value of this variable is set to zero.

//The second function in the script is called changeimage. This function increases the value of the banneradcode variable, ensuring that if it is too large for the number of different images, it is reset to zero. If you use this script with a different number of images, you will need to change the maximum value from 4 to the number of images you want to use.

//After changing the banneradcode variable, the function changes the image source ("src") of the image that has the name of bannerad to point to the next image in the sequence. This is the part of the script which actually changes the image on the page.

//The final function in the script is called changepage, and is called when the Banner Ad is clicked on. This function reads the value of banneradcode, and sets an appropriate value for the variable newlocation. If you want to use this script on your own pages, then these links can be changed to whatever you want. The function then sets the location to the newlocation. "location" is a built-in feature of JavaScript that allows you to specify the URL of the page loaded in the web browser. Note that if the browsertype is set to "old" it will set the page location to another page.

//Note that both the changeimage and the changepage functions have been set up so that they will only work if the browsertype has been set to "new". This avoids the problems of error messages appearing when the page is viewed in a browser that does not support the later additions to the JavaScript language that are required for the functions to work.

//Future modifications to the script:

//As always, JavaScripts can always be improved upon, so here are two possible suggestions for further enhancements: 

//The script currently cycles through a series of images, but it would not be too difficult to modify it to show the images in a random order. 
//The major drawback with this script is that it does not work with Internet Explorer 3. This is due to the fact the IE3 doesn't support the image object like the other browsers do. With some future work it could be made to work with IE3 - but I'll let you figure that one out! 
//Author: Jay Xu
//This is Ending of banner ads


