// JavaScript Document
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

function blendimage(divid, imageid, imagefile, millisec) {
    var xrl = "http://www.us-asianchamber.org/";
	var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).src = xrl+imagefile;

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}
//breadcrumbs
function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a href=\"/\">Home</a>  |  ";
  sURL = location.href;
  //replace search. Remove query string variables and return the page only; 
  sURL = sURL.replace(location.search,"")
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
	//replace search
    //bits[i] = bits[i].replace(search,"")
	output += bits[i] + "/\">" + bits[i].replace(/%20/g,"&nbsp;") + "</a>  |  ";
  }
  document.write(output + document.title);
}
//show hide search
function showSearch(){
	 document.getElementById("searchBar").style.visibility = "visible";
	 document.getElementById("searchBTN").style.visibility = "visible";
	// document.getElementById("searchBlend").style.visibility = "hidden";
	}
function hideSearch(){
	 document.getElementById("searchBar").style.visibility = "hidden";
	 document.getElementById("searchBTN").style.visibility = "hidden";
	// document.getElementById("searchBlend").style.visibility = "visible";
	}
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  //alert('Query Variable ' + variable + ' not found');
}
serNum = getQueryVariable("num")
switch(serNum)
{
case "1":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L$*|5^cwS/unNJV#qk" ;
break;
case "2":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L3Zm5zx=AMth?|kpb";
break;
case "3":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]Lmy|[y)X92F(";
break;
case "4":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L|'EMrTKTc7aCCp9.OEv9";
break;
case "5":
xserial ="JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L$*|5^cgEZ6AGpV#qk";
break;
case "6":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]LVc^l[)=^.IvNJV#qk";
break;
case "7":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L3Zm5jZbU5#ergtC";
break;
case "8":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]LEDvm[f@x75";
break;
case "9":
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]LEDvm[G@x75";
break;
case "10":
xserial ="JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]LgcEY=ce/7ce_iJin)Fo" ;
break;
case "11":
xserial ="JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L$|e$||JEZX[*aW" ;
break;

default:
xserial = "JV2mP'ex,cT7Qcn .Z7r*7tN;cvd? PC N)FkSc/KKgt=]L$*|5^cgEZ6AGpV#qk";
}

 
