<!--
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});
				if(ie6()) hideselects();
			}

		}
	}
}
function closeEmailFriend() {
	emailFriendResp();
	new Effect.Fade('email_friend',{duration:0.4});
	new Effect.Fade('greyout',{from:0.8,to:0.0,duration: 0.2})
	if (ie6()) showselects();
	setTimeout(function () {$('email_friend').innerHTML = '';},800);
}

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





function emailPrice(prod) {
		var getstring = 'prod='+prod;
		if (document.forms["emailpriceform"]) {
			lis=document.forms["emailpriceform"].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/emailprice.php?"+getstring);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = emailFriendResp;
	http.send(null);
}



function suggestArticle() {
		var getstring = '1=1';
		if (document.forms["suggestarticleform"]) {
			lis=document.forms["suggestarticleform"].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/suggestarticle.php?"+getstring);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = emailFriendResp;
	http.send(null);
}

















/*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", "includes/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();",7000);
			}

		}
	}
}
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 == 'banner') {
                        fades[i] = it[a];
                        i++;
                }
        }

        if (fades.length == 1) {return;}
        var viewctrl = 1;
	var onetofade=''
        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;
                new Effect.Fade(onetofade,{duration:0.1});
                new Effect.Appear(onetoshow,{duration:0.1});
        } 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=='active' && it.length > 1) {
                        it[a].className = '';
                }

        }
        
document.getElementById('slidectrl'+viewctrl).className='active';
        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";
		}
	}
}


// -->
<!--
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 hideselects(){
selects=document.body.getElementsByTagName('SELECT');
numsels=selects.length;
for (a=0;a<numsels;a++){
if (selects[a].className!='replaced'){
selects[a].style.visibility="hidden";
}
}
}

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


function navOn(to) {
	$('navpop_'+to).style.display='block';
	$('navbut_'+to).className='lnkon';
	if (ie6()) {
		hideselects();
/*		if (to=='goal') {
			$('navpop_'+to).style.width="308px";
		}
		else if (to=='info') {
			$('navpop_'+to).style.width="154px";
		}
		else {
			$('navpop_'+to).style.width="458px";
		} */
	}
}
function navOff(to) {
	$('navpop_'+to).style.display='none';
	$('navbut_'+to).className='lnk';
	if (ie6()) showselects();
}

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/icon_minus.gif';
	}
	else {
		new Effect.SlideUp(div,{duration: 0.5});
		$('arrowimg'+id).src='images/nav/icon_plus.gif';
	}
}

function ie6() {
	return (navigator.userAgent.toLowerCase().indexOf("msie 6")>0);
}

function postComment(){
	new Ajax.Updater('commentbuffer','servers/comment.php',{asynchronous:true,postBody:Form.serialize('commentform'),evalScripts:true,onSuccess:function(req){ new Insertion.Top('allcomments',req.responseText); new Effect.SlideDown($('allcomments').firstChild.id);$('couldbefirst').style.display='none';}});
}

function getAllArticles(type,div,start,ignore) {
	var ignorepb = '';
	if (ignore != undefined) ignorepb = '&ignore='+ignore;
	new Ajax.Updater(div,'servers/getarticles.php',{asynchronous: true, evalScripts: true, postBody: 'type='+type+'&start='+start+ignorepb,onSuccess: function () { new Effect.Appear(div);}});
}
function showCommentForm() {
	if ($('commentformdiv').style.display =='none') {
		new Effect.SlideDown('commentformdiv',{duration:0.4});
	}
	new Effect.ScrollTo('commentformdiv',{duration:0.4});
}

var opened = '';
function showProd(pid) {
	if (opened) closeProd(opened);
	opened = pid;
	document.getElementById('prod_'+pid).style.display="block";
}
function closeProd(pid) {
	opened = '';
	document.getElementById('prod_'+pid).style.display="none";
}
