<!--


function MM_openBrWindow(theURL,winName,features) { //v2.0


  window.open(theURL,winName,features);


}
//-->
<!--
function linkpage() {
    msgWindow = window.open('','targetname','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=520,height=640');
    msgWindow.location.href = 'wfindernew/finder.php';
    if (msgWindow.opener == null) msgWindow.opener = self;
}
//-->
<!--//


/***********************************************
* 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 showNav(section){
	thestyle = document.getElementById(section).style;
	if(section=='desc'){
		thestyle.display = 'block';
		document.getElementById('rev').style.display='none';
		document.getElementById('vid').style.display='none';
		document.getElementById('vidtab').src="images/prod/videos.gif";
		document.getElementById('revtab').src="images/prod/reviews.gif";
		document.getElementById('dettab').src="images/prod/det1.gif";

	}else if(section=='rev'){
		thestyle.display = 'block';
		document.getElementById('desc').style.display='none';
		document.getElementById('vid').style.display='none';
		document.getElementById('vidtab').src="images/prod/videos.gif";
		document.getElementById('revtab').src="images/prod/reviews2.gif";
		document.getElementById('dettab').src="images/prod/det2.gif";

	}
	else if(section=='vid'){
		thestyle.display = 'block';
		document.getElementById('desc').style.display='none';
		document.getElementById('rev').style.display='none';
		document.getElementById('vidtab').src="images/prod/videos2.gif";
		document.getElementById('revtab').src="images/prod/reviews.gif";
		document.getElementById('dettab').src="images/prod/det2.gif";
	}

	/*
	if(thestyle.display=='none')
		thestyle.display = 'block';
	else
		thestyle.display = 'none';
	*/
}
// -->
<!--
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 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=400');");
}

// -->

<!--
function popUp10(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=950,height=650');");
}

// -->

<!--
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 popSize(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=535,height=520');");
}

// -->
<!--
function popSize2(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=535,height=560');");
}

// -->

<!--
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=500,height=500');");
}

// -->
<!--
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;
}
//-->
//Functions for funky select box
function createRequestObject() {
	var ro;
	ro = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	return ro;
}

var http;
function showmenuchildren(id){
	lis=document.getElementById(id).getElementsByTagName('li');
	for (var i=0; i<lis.length; i++){
		if (lis[i].style.display=="block") lis[i].style.display="none";
		else {
			lis[i].style.display="block";
			lis[i].style.zindex="1000";
			lis[i].style.position="relative";
		}
	}
}

function showmenuchildrenselective(id){
	lis=document.getElementById(id).getElementsByTagName('li');
	for (var i=0; i<lis.length; i++){
		if (lis[i].style.display=="block") lis[i].style.display="none";
		else {
			lis[i].style.display="block";
			lis[i].style.zindex="1000";
			lis[i].style.position="relative";
		}
	}
}

function qlswitchtab(prodid,optordesc){
	if (optordesc=="opt"){
		document.getElementById("qltabopt"+prodid).style.display="block";
		document.getElementById("qltabdesc"+prodid).style.display="none";
	} else {
		document.getElementById("qltabopt"+prodid).style.display="none";
		document.getElementById("qltabdesc"+prodid).style.display="block";
	}


}

var hasSize = 0;
var colorList = new Object();
var sizeGroup = '';
var selectedColor = '';

function addToColorList(color) {
//	console.log(color);
	colorList[color] = new Object();
}

function addSizeToColor(size, color, group, sizeid) {
//	console.log('size to color: '+size+' :: '+color);
	colorList[color][size] = sizeid;
}

function checkSizeColor(size, color) {
	for(sizeItem in colorList[color]) {
		if(sizeItem == size)
			return true;
	}
	return false;
}

function setColor(color) {
	selectedColor = color;
}

function limitTheSizes(color) {
/*
	console.log(color);
	for(sizeItem in colorList[color]) {
		console.log(sizeGroup);
		console.log("#"+colorList[color][sizeItem]+" li");
		$$("#"+sizeGroup+" li").each(function(li) {
//			Element.remove(li);
		});
		li = $("optli"+sizeGroup+"id"+colorList[color][sizeItem]);
		console.log(li);
	}
*/
}

function setSizeGroup(id) {
	sizeGroup = id;
}

function updatedependentlist(dependentlist, constraint) {

}

function updateselectedfromli2(optgroup,optid,issize,countvar,prodid){
	origheader=document.getElementById('prodtextconst'+prodid).innerHTML;
	document.getElementById(optgroup+"hidden").value=optid;
	switch (countvar){
	case '0': updateprice0(); break;
	case '1': updateprice1(); break;
	case '2': updateprice2(); break;
	case '3': updateprice3(); break;
	case '4': updateprice4(); break;
	case '5': updateprice5(); break;
	case '6': updateprice6(); break;
	case '7': updateprice7(); break;
	case '8': updateprice8(); break;
	case '9': updateprice9(); break;
	case '10': updateprice10(); break;
	case '12': updateprice12(); break;
	case '13': updateprice13(); break;
	case '14': updateprice14(); break;
	case '15': updateprice15(); break;
	case '16': updateprice16(); break;
	case '17': updateprice17(); break;
	case '18': updateprice18(); break;
	case '19': updateprice19(); break;
	case '20': updateprice20(); break;
	case '21': updateprice21(); break;
	case '22': updateprice22(); break;
	case '23': updateprice23(); break;
	case '24': updateprice24(); break;
	case '25': updateprice25(); break;
	case '26': updateprice26(); break;
	case '27': updateprice27(); break;
	case '28': updateprice28(); break;
	case '29': updateprice29(); break;
	default : updateprice0();
	}
	if (issize=='5') updateimage(optgroup,'0',countvar,prodid);
	if (issize=='5') selectedtextf=document.getElementById(optid+'option').innerHTML;
	else selectedtextf=document.getElementById('optlit'+optgroup+'id'+optid).innerHTML;
	if (issize=='0'){
		updateimage3(optgroup,0,0,'',optid);
		var sku=document.getElementById('skuoptli'+optgroup+'id'+optid).innerHTML;
		if (sku=='') sku='Not available';
		document.getElementById('sku').innerHTML='Product SKU: '+sku;
	}
	selectedtextf=selectedtextf.replace(/.nbsp./gi,'');
	selectedtext=selectedtextf.substring(0,12)+'...';
	if (issize!='5') document.getElementById(optgroup+'select').innerHTML=selectedtext;
	if (issize=='0') document.getElementById('prodtext'+prodid).innerHTML="<h1>"+origheader+"</h1><h2>"+selectedtextf+"</h2>";
	if (issize=='5') document.getElementById('prodtext'+prodid).innerHTML=selectedtextf;
	if(hasSize == 1)
		changeColor("updatelist");
}

function updateselectedfromli(optgroup,optid,issize,countvar,prodid){
	origheader=document.getElementById('prodtextconst'+prodid).innerHTML;
	document.getElementById(optgroup+"hidden").value=optid;
	switch (countvar){
	case '0': updateprice0(); break;
	case '1': updateprice1(); break;
	case '2': updateprice2(); break;
	case '3': updateprice3(); break;
	case '4': updateprice4(); break;
	case '5': updateprice5(); break;
	case '6': updateprice6(); break;
	case '7': updateprice7(); break;
	case '8': updateprice8(); break;
	case '9': updateprice9(); break;
	case '10': updateprice10(); break;
	case '12': updateprice12(); break;
	case '13': updateprice13(); break;
	case '14': updateprice14(); break;
	case '15': updateprice15(); break;
	case '16': updateprice16(); break;
	case '17': updateprice17(); break;
	case '18': updateprice18(); break;
	case '19': updateprice19(); break;
	case '20': updateprice20(); break;
	case '21': updateprice21(); break;
	case '22': updateprice22(); break;
	case '23': updateprice23(); break;
	case '24': updateprice24(); break;
	case '25': updateprice25(); break;
	case '26': updateprice26(); break;
	case '27': updateprice27(); break;
	case '28': updateprice28(); break;
	case '29': updateprice29(); break;
	default : updateprice0();
	}
	if (issize=='5') updateimage(optgroup,'0',countvar,prodid);
	if (issize=='5') selectedtextf=document.getElementById(optid+'option').innerHTML;
	else selectedtextf=document.getElementById('optlit'+optgroup+'id'+optid).innerHTML;
	if (issize=='0'){
		updateimage2(optgroup,0,0,'',optid);
		var sku=document.getElementById('skuoptli'+optgroup+'id'+optid).innerHTML;
		if (sku=='') sku='Not available';
		document.getElementById('sku').innerHTML='Product SKU: '+sku;
	}
	selectedtextf=selectedtextf.replace(/.nbsp./gi,'');
	selectedtext=selectedtextf.substring(0,12)+'...';
	if (issize!='5') document.getElementById(optgroup+'select').innerHTML=selectedtext;
	if (issize=='0') document.getElementById('prodtext'+prodid).innerHTML="<h1>"+origheader+"</h1><h2>"+selectedtextf+"</h2>";
	if (issize=='5') document.getElementById('prodtext'+prodid).innerHTML=selectedtextf;
}

//Functions for UberCart
var quant;
var iscomplete=1;
var sizeOption="";
function addtocart(countvar,noopts){
http  = createRequestObject();
	getstring='';
	var isvalid=0;
	if (noopts==1) isvalid=1;
	if (noopts!=1) { if (formvalidator0(document.forms["tForm"+countvar]) && iscomplete==1) isvalid=1;}
	if (isvalid==1){
		iscomplete=0;
		lis=document.forms["tForm"+countvar].getElementsByTagName('input');
		for (var i=0; i<lis.length; i++){
			if (lis[i].name!='frompage') getstring+=(lis[i].name+"="+lis[i].value+'&');
			if (lis[i].name=='quant') quant=lis[i].value;
		}
		lis=document.forms["tForm"+countvar].getElementsByTagName('select');
		for (var i=0; i<lis.length; i++){
			if(lis[i].value == "") {
				getstring+= (lis[i].name+"="+sizeOption+'&');
			} else {
				getstring+= (lis[i].name+"="+lis[i].value+'&');			
			}
		}
//		console.log(getstring);
		http.open("get", "vsadmin/inc/ajaxcarter.php?"+getstring);
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange = handlecartResponse;
		http.send(null);
	}
}
function addtowish(countvar,noopts){
	getstring='';
	var isvalid=0;
	if (noopts==1) isvalid=1;
	if (noopts!=1){ if (formvalidator0(document.forms["tForm"+countvar])) isvalid=1; }
	if (isvalid==1) {
		lis=document.forms["tForm"+countvar].getElementsByTagName('input');
		var pid='';
		for (var i=0; i<lis.length; i++){
			if (lis[i].name!='frompage') getstring+=(lis[i].name+"="+lis[i].value+'&');
			if (lis[i].name=='id') pid=lis[i].value;
		}
		lis=document.forms["tForm"+countvar].getElementsByTagName('select');
		for (var i=0; i<lis.length; i++){
			getstring+= (lis[i].name+"="+lis[i].value+'&');
		}
		getstring+='foo=1';
		pname=pid.replace(/-/gi,' ');
		if (pname.length>43) pname=pname.substring(0,40)+'...';
		genajax('vsadmin/addwish.php?'+getstring,'wishdiv',Effect.Appear,'',pname);	
	} else return false;
}

function handlecartResponse () {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		cartdiv=document.getElementById("minicartajax");
		if (response){
			document.getElementById("bagvol").style.display="none";
			cartdiv.innerHTML=response;
			cartdiv.style.position="absolute";
			Effect.SlideDown(cartdiv.id);
			oldvol=document.getElementById("rbagvol").innerHTML;
			newvol=oldvol-(-quant);
			document.getElementById("rbagvol").innerHTML=newvol;
			if (newvol==1) newcontent='<center>1 item in <strong>my bag</strong></center>';
			else if (newvol<10) newcontent='<center>'+newvol+' items in <strong>my bag</strong></center>';
			else newcontent='<center>'+newvol+' items</center>';
			document.getElementById("bagvol").innerHTML = newcontent;
			Effect.Appear('bagvol');
			iscomplete=1;
		}
	}
}

function wrapbox(){

http  = createRequestObject();
		http.open("get", "vsadmin/inc/ajaxgiftwrap.php");
		http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		http.onreadystatechange = handleWrapResponse;
		http.send(null);
}

function handleWrapResponse() {
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		wrapboxdiv=document.getElementById("wrapboxpop");
		if (response){
			if (wrapboxdiv.style.display!="none")	{
				Effect.SlideUp(wrapboxdiv.id);
			//	wrapboxdiv.style.display="none";
				document.getElementById('wrappxh').value='0';
				document.getElementById('wrapselect').selectedIndex='-1';
				updateprice0();
			} else {
				wrapboxdiv.innerHTML=response;
				wrapboxdiv.style.position="relative";
//				wrapboxdiv.style.float="left";
			//	wrapboxdiv.style.display="block";
				Effect.SlideDown(wrapboxdiv.id);
				updateprice0();
			}
		}
	}
}

function wrapupdate(id){

http  = createRequestObject();
	http.open("get", "vsadmin/inc/ajaxgiftwrap.php?giftid="+id);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = handleWrapSelectResponse;
	http.send(null);
}

function handleWrapSelectResponse(){
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		update=response.split("|");
		gotwrapim=update[0];
		gotwrappx=update[1];
		gotwrapid=update[2];
		wrapimg=document.getElementById('wrapimg');
		wrappx=document.getElementById('wrappx');
		wrapcheck=document.getElementById('wrapcheck');
		wrappxh=document.getElementById('wrappxh');
		wrapimg.src=gotwrapim;
		wrappx.innerHTML='+'+formatprice((gotwrappx/100),'','');
		wrappxh.value=gotwrappx;
		wrapcheck.value=gotwrapid;
		updateprice0();
	}
}
var gendiv='';
var geneffect='';
var genrelpath='';
var gentitle='';
function genajax(url,div,effect,relpath,title){
	windowheight=findWindowHeight();
	windowwidth =findWindowWidth();
	document.getElementById('pleasewait').style.top=((windowheight/2)-50)+"px";
	document.getElementById('pleasewait').style.left=((windowwidth/2)-50)+"px";
	slide (document.getElementById('pleasewait'));
	Effect.Appear('pleasewait');
	gendiv=div;
	geneffect=effect;
	genrelpath=relpath;
	gentitle=title;

http  = createRequestObject();
	http.open("get", url);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = handleGenResponse;
	http.send(null);
}
var remwishid='';
function removefromlist(wishid){
	remwishid=wishid;
http  = createRequestObject();
	http.open("get", "vsadmin/viewwish.php?standalone=1&rem=1&wishid="+wishid);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = handleRemResponse;
	http.send(null);
}

function handleRemResponse(){
	Effect.BlindUp(remwishid+"wish");
//	document.getElementById(remprodid).innerHTML='';


}
function nukeback(div,backer){
	Effect.Fade(div); 
	Effect.Fade(backer);
	showselects();
}

var ie=document.all;
var nn6=document.getElementById&&!document.all;

var isdrag=false;
var x,y;
var dobj;

function movemouse(e)
{
  if (isdrag)
  {
//  alert (dobj.id);
//  alert (dobj.style.margin.left);
    dobj.style.left = nn6 ? tx + e.clientX - x + "px": tx + event.clientX - x +"px";
    dobj.style.top  = nn6 ? ty + e.clientY - y + "px": ty + event.clientY - y +"px";
    return false;
  }
}

function selectmouse(e) 
{
  var fobj       = nn6 ? e.target : event.srcElement;
  if (fobj.className!='dragbar') return false;
  var topelement = nn6 ? "HTML" : "BODY";
    fobj = nn6 ? fobj.parentNode.parentNode.parentNode.parentNode.parentNode : fobj.parentElement.parentElement.parentElement.parentElement.parentElement;
    isdrag = true;
    dobj = fobj;
    tx = parseInt(dobj.offsetLeft-(dobj.style.marginLeft.replace(/px/gi,'')));
    ty = parseInt(dobj.offsetTop+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
}
document.onmouseup=new Function("isdrag=false");

function handleGenResponse() {
	div=gendiv;
	header='<div class=dragme style="background:url(\'images/grad.gif\') repeat-x; color:#fff;font-weight:bold;width:100%;height:19px;"><table cellspacing=0 cellpadding=0 width=100%><tr><td id=dragbar class=dragbar align=left style="padding-left:6px;color:white;padding-top:2px;cursor:move;">'+gentitle+'</td><td align=right><span onclick="nukeback(\''+div+'\',\''+div+'overlay\')" style="cursor:pointer;"><img src="'+genrelpath+'images/cross.gif"></span></td></tr></table></div>';
	if(http.readyState == 4){
		var response = http.responseText;
		var update = new Array();
		var objBody = document.getElementsByTagName("body").item(0);
		boxdiv=document.getElementById(div);
		//boxdiv.style.zIndex="200";
		if (backer=document.getElementById(div+'overlay')) {} else {
		backer=document.createElement('div');
		backer.setAttribute('id',div+'overlay');
		backer.setAttribute('class','woverlay');
		backer.setAttribute('onclick','nukeback("'+div+'","'+backer.id+'");');
		backer.height="100%";
		backer.width="100%";
		backer.style.zIndex=boxdiv.style.zIndex-1;
		backer.style.position="absolute";
		backer.style.top="0px";
		backer.style.left="0px";
		objBody.appendChild(backer); 
		}
		var arrayPageSize = getPageSize();
		backer.height= arrayPageSize[1]+'px';
		backer.style.height= arrayPageSize[1]+'px';
		backer.style.display="block";
		if (response){
			if (boxdiv.style.display!="none")	{
	//			Effect.SlideUp(div);
			} else {
				Effect.Fade('pleasewait');
				boxdiv.innerHTML=header+response;
				boxdiv.style.position="absolute";
				boxdiv.style.background="white";
				boxdiv.style.overflow="hidden";
				hideselects();
				geneffect(div);
				boxdiv.firstChild.firstChild.firstChild.firstChild.firstChild.onmousedown=selectmouse;
				initLightbox();
			}
		}
	}
}
var divtocloseg=''
function subformsubmit(parentid,submittarget,divtoclose){
	divtocloseg=divtoclose;
	parentobj=document.getElementById(parentid);
	inputs=parentobj.getElementsByTagName('input');
	submitstring=submittarget;
	for (a=0;a<inputs.length;a++){//pricepercent weightpercent
		if (inputs[a].type=="checkbox"){
			if (inputs[a].checked){
				submitstring+=inputs[a].name+"="+inputs[a].value.escapeHTML()+"&";
			}
		} else
		submitstring+=inputs[a].name+"="+inputs[a].value.escapeHTML()+"&";
	}
http  = createRequestObject();
	submitstring+="divtoclose="+divtoclose.replace(/popupdiv/gi,"resultdiv");
	http.open("get", submitstring);
	http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	http.onreadystatechange = subformResponse;
	http.send(null);
}

function subformResponse(){
	feedbackdiv=divtocloseg.replace(/popupdiv/gi,"resultdiv");
	feedbackobj=document.getElementById(feedbackdiv);
	closerobj  =document.getElementById(divtocloseg);
	header='<div style="color:black;font-weight:bold;width:100%;height:16px;"><table cellspacing=0 cellpadding=0 width=100%><tr><td><span onclick="Effect.Fade(feedbackdiv)" style="cursor:pointer;"><img src="../images/closelabel.gif"></span></td><td align=right></td></tr></table></div>';
	if(http.readyState == 4){
		var response = http.responseText;
		if (response){
			feedbackobj.innerHTML=header+response;
			feedbackobj.style.position="absolute";
			feedbackobj.style.background="white";
			Effect.Appear(feedbackdiv);
			Effect.Fade(divtocloseg);
			closerobj.innerHTML='';
		}
	}
	
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function findWindowHeight() {
	var y
	if (window.innerHeight){ 
		y = window.innerHeight;
	} else if (document.documentElement && document.documentElement.offsetHeight){
		y = document.documentElement.offsetHeight;
	}else if (document.body){
		y = document.body.offsetHeight;
	}
	return y;
}

function findWindowWidth() {
	var x
	if (window.innerWidth){ 
		x = window.innerWidth;
	} else if (document.documentElement && document.documentElement.offsetWidth){
		x = document.documentElement.offsetWidth;
	}else if (document.body){
		x = document.body.offsetWidth;
	}
	return x;
}

function slide(obj) {
	if (obj) {
		var sTop = getScroll();
		var sBot = sTop + findWindowHeight();
		var objTop = findPosY(obj);
		var objBot = findPosY(obj)+obj.scrollHeight;
		if (objBot > (sBot-30)) {
			setScroll(0,sTop+(objBot-sBot));
		} else if (objTop < sTop) {
			setScroll(0,objTop);
		}
	}
}

function getScroll() {
	var x,y;
	if (self.pageYOffset) // all except Explorer
	{
		x = self.pageXOffset;
		y = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	return y;
}

function setScroll(x,y) {
	if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		document.documentElement.scrollLeft = x;
		document.documentElement.scrollTop = y;
	}
	else if (document.body) // all other Explorers
	{
		document.documentElement.scrollLeft = x;
		document.documentElement.scrollTop = y;
		document.body.scrollLeft = x;
		document.body.scrollTop = y;
	}
	else if (self.pageYOffset) // all except Explorer
	{
		self.pageXOffset = x;
		self.pageYOffset = y;
	}
	return;
}

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";
		}
        }
}
						
