<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//-->
<!--


function MM_openBrWindow(theURL,winName,features) { //v2.0


  window.open(theURL,winName,features);


}


//-->
<!--
function openDSWindow(id) {
window.open('free-gifts.php','special_offers','menubar=no, scrollbars=no, width=500, height=270, directories=no,location=no,resizable=yes,status=no,toolbar=no')
}
//-->

<!--
function openNSWindow(id) {
window.open('top-names.php','special_offers','menubar=no, scrollbars=no, width=500, height=270, directories=no,location=no,resizable=yes,status=no,toolbar=no')
}
//-->

<!--
function popUpVideoLarge(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=690,height=670');");
}

// -->

<!--
function popUpVideoMed(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=420');");
}

// -->


<!--//


/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)


function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
if (ccollect[inc].style.display!='none') Effect.SlideUp(ccollect[inc].id);
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid);
Effect.SlideDown(cid);
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate
// -->
<!--// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 500;
defaultHeight = 500;
// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = false;
// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" >');
writeln('<img name="Product" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

// -->

<!--
function launch(url, popup,x,y) {
self.name = "opener";
remote = open(url, popup, "width="+x+",height="+y);
}
// -->



<!--
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=700');");
}

// -->
<!--
function popUp8(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=190');");
}

// -->

<!--
function popUp9(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=350');");
}

// -->
<!--
function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=480');");
}

// -->

<!--
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=475,height=385');");
}

// -->

<!--
function launch(url, popup,x,y) {
self.name = "opener";
remote = open(url, popup, "width="+x+",height="+y);
}
// -->

<!--
function popC(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=350,height=350');");
}

// -->
<!--
function popP(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=270');");
}

// -->
<!--
function popZ(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=355');");
}

// -->
<!--
function popNav(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=697,height=600');");
}

// -->
<!--
function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=390,height=340');");
}

// -->
<!--
function popUp5(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=410,height=390');");
}

// -->
<!--
function popUp7(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=410,height=270');");
}

// -->
<!--
function popIP(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=440,height=340');");
}

// -->

<!--
function popNav2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=740,height=490');");
}

// -->
<!--
function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}


//-->

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->



function emailFriend(prod) {
		var getstring = 'prod='+prod;
		if (document.forms["emailfriendform"]) {
			lis=document.forms["emailfriendform"].getElementsByTagName('input');
			for (var i=0; i<lis.length; i++){
				 getstring += '&'+lis[i].name+"="+escape(lis[i].value);
			}
			getstring += '&comments='+escape($('comments').value);
		}
	http.open("get", "tstoreadmin/emailfriend.php?"+getstring);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = emailFriendResp;
	http.send(null);
//	genajax('tstoreadmin/emailfriend.php?prod='+prod,'wishdiv',Effect.Appear,'',pname);
}

function emailFriendResp() {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		emaildiv = document.getElementById('email_friend');
		if (response){
			emaildiv.innerHTML = response;
			if (emaildiv.style.display == "none") {
				pagesize = getPageSize();
				document.getElementById('greyout').style.height=pagesize[1]+'px';
				new Effect.Appear('greyout',{from:0.0,to:0.8,duration:0.2});
				new Effect.Appear(emaildiv.id,{duration:0.4});
			}
			
		}
	}
}
function closeEmailFriend() {
	emailFriendResp();
	new Effect.Fade('email_friend',{duration:0.4});
	new Effect.Fade('greyout',{from:0.8,to:0.0,duration: 0.2})
	setTimeout(function () {$('email_friend').innerHTML = '';},800);
}

function createRequestObject() {
	var ro;
	ro = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	return ro;
}
var http = createRequestObject();




/*Duplicate
function toggleCatList(stick,id) {
//	if (catlistchange[id]) {
//		return;
//	}
//	catlistchange[id] = 1;
	if (stick == 1) {
		//new Effect.SlideDown('categorylist'+id,{duration: 0.2});
		$('categorylist'+id).style.display = "block";
//		toggleCatListOn(id);
	}
	else if ($('categorylist'+id).style.display != 'none') {
		//new Effect.SlideUp('categorylist'+id,{duration: 0.2});
		$('categorylist'+id).style.display = "none";
	}
//	setTimeout("catlistchange["+id+"] = 0;",500);
}
var catlistlock = Array();
//var catlistchange = Array();
function toggleCatListOn(id) {
	catlistlock[id] = 1;
}
function toggleCatListOut(id) {
	catlistlock[id] = 0;
	setTimeout("if (catlistlock["+id+"] != 1) { toggleCatList(0,"+id+"); }",1);
}
*/

function submitcontact(){
	namegot=document.getElementById('name').value;
	emailgot=document.getElementById('emailquest').value;
	commentgot=document.getElementById('question').value;
	productidgot=document.getElementById('productid').value;
	http.open("get", "question.php?submit=1&name="+namegot+"&prod="+productidgot+"&email="+emailgot+"&comment="+escape(commentgot));
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = handleContactResponse;
	http.send(null);
}

function handleContactResponse(){
	if(http.readyState == 4){
		mainresp = http.responseText;
		document.getElementById('formdiv').innerHTML=mainresp;
		new Effect.Highlight('formdiv');
	}
}

function newsletter() {
		var getstring = '';
		if (document.forms["newsletterform"]) {
			lis=document.forms["newsletterform"].getElementsByTagName('input');
			for (var i=0; i<lis.length; i++){
				 getstring += '&'+lis[i].name+"="+escape(lis[i].value);
			}
		}
	if (!$('news_join')) {
		$('fullscreen').innerHTML += "<div id='news_join' style='display: none';></div>";
	}
	http.open("get", "tstoreadmin/newsletter.php?"+getstring);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = newsletterResp;
	http.send(null);
//	genajax('tstoreadmin/emailfriend.php?prod='+prod,'wishdiv',Effect.Appear,'',pname);
}

function newsletterResp() {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		emaildiv = document.getElementById('news_join');
		if (response){
			emaildiv.innerHTML = response;
			if (emaildiv.style.display == "none") {
				pagesize = getPageSize();
				$('greyout').style.height=pagesize[1]+'px';
				new Effect.Appear('greyout',{from:0.0,to:0.8,duration:0.2});
				new Effect.Appear(emaildiv.id,{duration:0.4});
				hideelements('SELECT');
			}
			if ($('newsletter_success')) {
				setTimeout("closeNewsletter();",10000);
			}
			
		}
	}
}
function closeNewsletter() {
	new Effect.Fade('news_join',{duration:0.4});
	new Effect.Fade('greyout',{from:0.8,to:0.0,duration: 0.2})
	showelements('SELECT');
	setTimeout(function () {$('news_join').innerHTML = '';},800);
}

function menuShowSection(id) {
	var div = $('subcat'+id);
	if (div==undefined) return;
	if(div.style.display=='none') {
		new Effect.SlideDown(div,{duration: 0.5});
		$('arrowimg'+id).src='images/nav/but_arrow2.gif';
	}
	else { 
		new Effect.SlideUp(div,{duration: 0.5}); 
		$('arrowimg'+id).src='images/nav/but_arrow.gif';
	}
}



function addreview(id) {
        new Ajax.Updater('review_write','reviews.php?prod='+id+'&a=add',{asynchronous:true,evalScripts:true,postBody:Form.serialize('reviewform')});
}
function writereview(id) {
	new Ajax.Updater('review_write','reviews.php?prod='+id+'&a=write',{asynchronous:true,evalScripts:true});
}
function viewreviews(id,offset) {
        new Ajax.Updater('review_right','reviews.php?prod='+id+'&showright=1&a=view&revoffset='+offset,{asynchronous:true,evalScripts:true});
}

var globto;
function nextHpIm(view){
        var it = document.getElementById('slider1').childNodes;
        var i = 0;
        var fades = Array();
        for (a=0;a<it.length;a++){
                if (it[a].className == 'contentdiv') {
                        fades[i] = it[a];
                        i++;
                }
        }

        if (fades.length == 1) {return;}
        var viewctrl = 1;
        numfades=fades.length;
        for (a=0;a<fades.length;a++){
                if (fades[a].style.display!='none') {
                        onetofade=fades[a];
                        
onetoshow=(a-(-1))>(fades.length-1)?fades[0]:fades[(a-(-1))];
                        viewctrl = (a-(-1))>(fades.length-1)?1:(a-(-2));
                }
        }
        if (view!='') {
                viewctrl = view;
                clearTimeout(globto);
                onetoshow=fades[(view-1)];
                time=10000;
                onetofade.style.display='none';
                onetoshow.style.display='block';
        } else {
                time=8000;
                new Effect.Fade(onetofade);
                new Effect.Appear(onetoshow);
        }
        it = document.getElementById('slidectrl').childNodes;

        for (a=0;a<it.length;a++){
                if (it[a].className=='current' && it.length > 1) {
                        it[a].className = '';
                }

        }
        
document.getElementById('slidectrl'+viewctrl).className='current';
        globto=setTimeout('nextHpIm("");',time);
}

function toggleCatList(stick,id) {
        if (stick == 1) {
                //new Effect.SlideDown('categorylist'+id,{duration: 0.2});
                $('categorylist'+id).style.display = "block";
		
		if (navigator.userAgent.toLowerCase().indexOf("msie 6")>0) {
			hideelements('SELECT');
		}
		toggleCatListOn(id);
		
        }
        else if ($('categorylist'+id).style.display != 'none') {
                //new Effect.SlideUp('categorylist'+id,{duration: 0.2});
                $('categorylist'+id).style.display = "none";
		var totallock = 0;
		for (var i = 0; i < catlistlock.length; i++) {
		if (catlistlock[i] != undefined) totallock += parseInt(catlistlock[i]);
		}
		if (navigator.userAgent.toLowerCase().indexOf("msie 6")>0 && totallock == 0) {
			showelements('SELECT');
		}
        }
}
var catlistlock = Array();
function toggleCatListOn(id) {
        catlistlock[id] = 1;
}
function toggleCatListOut(id) {
        catlistlock[id] = 0;
        setTimeout("if (catlistlock["+id+"] != 1) { toggleCatList(0,"+id+"); }",1);
}


function hideelements(el){
	if (el==undefined) el = 'SELECT';
	selects=document.body.getElementsByTagName(el);
	numsels=selects.length;
	for (a=0;a<numsels;a++){
		if (selects[a].className!='replaced'){
			selects[a].style.visibility="hidden";
		}
	}
}

function showelements(el){
	if (el == undefined) el = 'SELECT';
	selects=document.body.getElementsByTagName(el);
	numsels=selects.length;
	for (a=0;a<numsels;a++){
		if (selects[a].className!='replaced'){
			selects[a].style.visibility="visible";
		}
	}
}
