// JavaScript Document
var theImages = new Array()

//Random-loading images
theImages[0] = 'skins/Skin_1/images/coinpurses_button.gif' // replace with names of images
theImages[1] = 'skins/Skin_1/images/funnybandages_button.gif' // replace with names of images
theImages[2] = 'skins/Skin_1/images/bracelets_button.gif' // replace with names of images
theImages[3] = 'skins/Skin_1/images/wallets_button.gif' // replace with names of images




var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<a href="t-shipping.aspx"><img src="skins/Skin_1/images/freeshipping_button.gif" alt="Free Shipping" /></a><a href="c-49-coin-purses.aspx"><img src="'+theImages[whichImage]+'" border=0 alt="Coin Purses" /></a><a href="c-20-novelty-games-toys.aspx"><img src="skins/Skin_1/images/kitsch_button.gif" alt="Kitsch" /></a><a href="c-18-shoes.aspx"><img src="skins/Skin_1/images/shoes_button.gif" alt="Shoes" /></a>');}
else if(whichImage==1){
document.write('<a href="c-10-bath-body.aspx"><img src="'+theImages[whichImage]+'" border=0 alt="Funny Bandages" /></a><a href="t-shipping.aspx"><img src="skins/Skin_1/images/freeshipping_button.gif" alt="Free Shipping" /></a><a href="c-29-home-kitchen.aspx"><img src="skins/Skin_1/images/letsparty_button.gif" alt="Lets Party" /></a><a href="c-33-mints-candy-gum.aspx"><img src="skins/Skin_1/images/crazycandy_button.gif" alt="Candy" /></a>');}
else if(whichImage==2){
document.write('<a href="c-14-bracelets.aspx"><img src="'+theImages[whichImage]+'" border=0 alt="Bracelets" /></a><a href="c-38-earrings.aspx"><img src="skins/Skin_1/images/earrings_button.gif" alt="Earrings" /></a><a href="t-shipping.aspx"><img src="skins/Skin_1/images/freeshipping_button.gif" alt="Free Shipping" /></a><a href="c-58-necklaces.aspx"><img src="skins/Skin_1/images/necklaces_button.gif" alt="Necklaces" /></a>');}
else if(whichImage==3){
document.write('<a href="c-22-wallets.aspx"><img src="'+theImages[whichImage]+'" border=0 alt="Wallets" /></a><a href="c-31-handbags-purses.aspx"><img src="skins/Skin_1/images/handbags_button.gif" alt="Handbags" /></a><a href="c-67-pill-boxes.aspx"><img src="skins/Skin_1/images/pillboxes_button.gif" alt="Pill Boxes" /></a><a href="t-shipping.aspx"><img src="skins/Skin_1/images/freeshipping_button.gif" alt="Free Shipping" /></a>');}

}

function hideAllDivsFirst() {
		faqD = document.getElementsByTagName('div');
		for(var i=0;i<faqD.length;i++) {
			if(faqD[i].className=="faqTab") {
				faqD[i].style.display = "none";
			}
		}
	}
	function showFAQ(which) {
		hideAllDivsFirst();
		targetDivName = "faq_"+which;
		tabLiName = "tab_"+which;
		document.getElementById(targetDivName).style.display = "block";
	}
	function swapTopTab(whichID,onoff) {
		if(document.getElementById(whichID).className=="tab_sub") document.getElementById(whichID).className = "tab_sub_over";
		else if(document.getElementById(whichID).className=="tab_sub_over") document.getElementById(whichID).className = "tab_sub";
	}
	function hilite(tID) {
		var allD = document.getElementsByTagName('li');
		for(var j=0;j<allD.length;j++) {
			if(allD[j].className=="tab_sub_selected") {
				allD[j].className = "tab_sub";
			}
		}
		var targetContentDiv = tID.split("_")[1];
		document.getElementById(tID).className = "tab_sub_selected";
		showFAQ(targetContentDiv);
	}
	
	
	
	
function appendsort() {
var Pathname = new String(document.location+'');

if (Pathname.indexOf("c-") !=-1) {
	
	if (document.getElementById('sortselector').selectedIndex == "1") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=13';
		
	}
	if (document.getElementById('sortselector').selectedIndex == "2") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=14';
	}
	

	if (document.getElementById('sortselector').selectedIndex == "3") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=7';
	}
	
	if (document.getElementById('sortselector').selectedIndex == "4") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=8';
	}
	
}

if (Pathname.indexOf("m-") !=-1) {
	
	if (document.getElementById('sortselector').selectedIndex == "1") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=17';
		
	}
	if (document.getElementById('sortselector').selectedIndex == "2") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=18';
	}
	

	if (document.getElementById('sortselector').selectedIndex == "3") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=11';
	}
	
	if (document.getElementById('sortselector').selectedIndex == "4") {	
			self.location=self.location.protocol+'//'+self.location.host+self.location.pathname+'?sortEntity=12';
	}
	
}
	

}
function checksort() {
	
	if (self.location.search.indexOf('13') != -1) {																	
		document.getElementById('sortselector').selectedIndex = "1"
	}
	
	else if (self.location.search.indexOf('14') != -1) {																	
		document.getElementById('sortselector').selectedIndex = "2"
	}

	else if (self.location.search.indexOf('7') != -1) {																	
		document.getElementById('sortselector').selectedIndex = "3"
	}
	
	else if (self.location.search.indexOf('8') != -1) {																	
		document.getElementById('sortselector').selectedIndex = "4"
	}
	

}
    function startList() {
    if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover=function() {
    this.className+=" over";
      }
      node.onmouseout=function() {
      this.className-=" over";
       }
       }
      }
     }
    }

window.onload=function(){
	checksort();
	startList();
}

	
