<!--


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 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=510');");
}

// -->

<!--
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", storeurl+"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();



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", storeurl+"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});
				new Effect.ScrollTo('news_join',{duration: 0.4});
			}
			if ($('newsletter_success')) {
				setTimeout("closeNewsletter();",1000);
			}
			
		}
	}
}
function closeNewsletter() {
	new Effect.Fade('news_join',{duration:0.4});
	new Effect.Fade('greyout',{from:0.8,to:0.0,duration: 0.2})
	setTimeout(function () {$('news_join').innerHTML = '';},800);
}
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";
		}
        }
}

//

var catlistlock4 = 0;
var catlistchange4 = 0;

function toggleCatList4(stick) {

	if (stick == undefined)
		stick = 1;
	if (catlistchange4) {
		return;
	}
	catlistchange4 = 1;
	if (stick == 1) {
		toggleCatList4On();
		if ($('nav_dd4').style.display=='none') {

			new Effect.SlideDown('nav_dd4',{duration: 0.2});
		}
	}
	else if ($('nav_dd4').style.display != 'none') {

		new Effect.SlideUp('nav_dd4',{duration: 0.2});
	}
	setTimeout("catlistchange4 = 0;",500);
}

function toggleCatList4On() {
	catlistlock4 = 1;
}
function toggleCatList4Out() {

	catlistlock4 = 0;
	setTimeout("if (catlistlock4 != 1) { toggleCatList4(0); }",1000);

}

//

var catlistlock3 = 0;
var catlistchange3 = 0;

function toggleCatList3(stick) {

	if (stick == undefined)
		stick = 1;
	if (catlistchange3) {
		return;
	}
	catlistchange3 = 1;
	if (stick == 1) {
		toggleCatList3On();
		if ($('nav_dd3').style.display=='none') {

			new Effect.SlideDown('nav_dd3',{duration: 0.2});
		}
	}
	else if ($('nav_dd3').style.display != 'none') {

		new Effect.SlideUp('nav_dd3',{duration: 0.2});
	}
	setTimeout("catlistchange3 = 0;",500);
}

function toggleCatList3On() {
	catlistlock3 = 1;
}
function toggleCatList3Out() {

	catlistlock3 = 0;
	setTimeout("if (catlistlock3 != 1) { toggleCatList3(0); }",1000);

}

//

var catlistlock2 = 0;
var catlistchange2 = 0;

function toggleCatList2(stick) {

	if (stick == undefined)
		stick = 1;
	if (catlistchange2) {
		return;
	}
	catlistchange2 = 1;
	if (stick == 1) {
		toggleCatList2On();
		if ($('nav_dd2').style.display=='none') {

			new Effect.SlideDown('nav_dd2',{duration: 0.2});
		}
	}
	else if ($('nav_dd2').style.display != 'none') {

		new Effect.SlideUp('nav_dd2',{duration: 0.2});
	}
	setTimeout("catlistchange2 = 0;",500);
}

function toggleCatList2On() {
	catlistlock2 = 1;
}
function toggleCatList2Out() {

	catlistlock2 = 0;
	setTimeout("if (catlistlock2 != 1) { toggleCatList2(0); }",1000);

}

//

var catlistlock = 0;
var catlistchange = 0;

function toggleCatList(stick) {

	if (stick == undefined)
		stick = 1;
	if (catlistchange) {
		return;
	}
	catlistchange = 1;
	if (stick == 1) {
		toggleCatListOn();
		if ($('nav_dd').style.display=='none') {

			new Effect.SlideDown('nav_dd',{duration: 0.2});
		}
	}
	else if ($('nav_dd').style.display != 'none') {

		new Effect.SlideUp('nav_dd',{duration: 0.2});
	}
	setTimeout("catlistchange = 0;",500);
}

function toggleCatListOn() {
	catlistlock = 1;
}
function toggleCatListOut() {

	catlistlock = 0;
	setTimeout("if (catlistlock != 1) { toggleCatList(0); }",1000);
}

//

function return_submit() {
	new Ajax.Updater('return_callback','return_call.php',{asynchronous: true,evalScripts: true,postBody:Form.serialize('returnform')});
}


var contactmethod_current = '';

function return_contactmethod(method) {
	if (method == contactmethod_current) return;

	var opts = ['leave','phone','email'];
	for (var i = 0; i < opts.length; i++) {
		if (method == opts[i]) {
			contactmethod_current = method;
			new Effect.SlideDown('contact_'+method,{duration: 0.5});
		}
		else {
			if ($('contact_'+opts[i]).style.display != 'none') {
				new Effect.SlideUp('contact_'+opts[i],{duration: 0.5});
			}
		}
	}
}
