
// global variables ////////////////////////////////////////////////////////////////////////////////////////
// global variables ////////////////////////////////////////////////////////////////////////////////////////
// global variables ////////////////////////////////////////////////////////////////////////////////////////


var postageCharge = 2.95;


var theAge = ""; 
var boyGirl = "";
var thisPageCategoryIndexNo = 0;

var l1NavHTML = "";
var l2NavHTML = "";
var smallPics = "";


var topRightNavHTML = '<a href="shop.html"><img src="images/home.png" alt="Home Page"></a><a href="contact.html"><img src="images/contact.png" alt="Contact Our First Shop"></a><a href="terms.html"><img src="images/terms.png" alt="Terms and Conditions"></a><a href="help.html"><img src="images/help.png" alt="Help"></a>'


// need to change in index.html too
var arrayOfAgeSexGroups = new Array();
arrayOfAgeSexGroups.push(new Array('5to7', 'boy', 'Boys aged 5 - 7'))
arrayOfAgeSexGroups.push(new Array('8to10', 'boy', 'Boys aged 8 - 10'))
arrayOfAgeSexGroups.push(new Array('11to13', 'boy', 'Boys aged 11 - 13'))
arrayOfAgeSexGroups.push(new Array('5to7', 'girl', 'Girls aged 5 - 7'))
arrayOfAgeSexGroups.push(new Array('8to10', 'girl', 'Girls aged 8 - 10'))
arrayOfAgeSexGroups.push(new Array('11to13', 'girl', 'Girls aged 11 - 13'))



// end global variables ////////////////////////////////////////////////////////////////////////////////////////
// end global variables ////////////////////////////////////////////////////////////////////////////////////////










// cookie functions ////////////////////////////////////////////////////////////////////////////////////////
// cookie functions ////////////////////////////////////////////////////////////////////////////////////////
// cookie functions ////////////////////////////////////////////////////////////////////////////////////////
// cookie functions ////////////////////////////////////////////////////////////////////////////////////////

// tests for cookies enabled
var cookieEnabled = false;
if (typeof document.cookie == "string") {
	if (document.cookie.length == 0) {
		setCookie("ctest", "CA14543957437589758584754789574985784758");
		var fishforthoughtctestRead = getCookie("ctest");
		if (fishforthoughtctestRead == "CA14543957437589758584754789574985784758") {
			cookieEnabled = true;
		}
		else {
			cookieEnabled = false;
		}
	}
	else {
		setCookie("ctest", "CA14543957437589758584754789574985784758");
		cookieEnabled = true;
	}
}



function getCookieVal(offset) {
	var endstr = document.cookie.indexOf(";", offset);
	if (endstr == -1) {
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}



function getCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal(j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return "";
}



function setCookie(name, value) {
	var exp = new Date(); // to fix bug with Safari
	exp.setTime(exp.getTime() + 995000000);
	var expires = true;
	var path = false;
	var domain = false;
	var secure = false;

	document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + exp.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}

// end cookie functions ////////////////////////////////////////////////////////////////////////////////////////
// end cookie functions ////////////////////////////////////////////////////////////////////////////////////////
// end cookie functions ////////////////////////////////////////////////////////////////////////////////////////


















function changeColours() {
	if (boyGirl == "boy") {
		document.bgColor = "#2BA3EC";
		document.getElementById("wrapper").style.backgroundColor = "#D6E1FF";
		document.getElementById("mainblock").style.backgroundColor = "#D6E1FF";

		if (document.getElementById("basket")) {
			document.getElementById("basket").style.background="transparent url(images/basket_back_boys.png) top left no-repeat";		}
	}
	else {
		document.bgColor = "#DC1182";
		//document.bgColor = "#FA8B8B";
		document.getElementById("wrapper").style.backgroundColor = "#F7CEB6";
		document.getElementById("mainblock").style.backgroundColor = "#F7CEB6";

		if (document.getElementById("basket")) {
			document.getElementById("basket").style.background="transparent url(images/basket_back_girls.png) top left no-repeat";
		}
	}
}





// called as they click about
function saveNavCookie(theLevel, theNumber) { // l1, l2, l3, 0, 1, 2 etc
	var str = new String(getCookie('lastNav'));
	var re = /_/;
	locArrayNav = str.split(re);
	var navToSave = locArrayNav[0] + "_" + locArrayNav[1];
	if (theLevel == "l1") {
		navToSave = navToSave + "_" + theNumber + "_" + '999' + "_" + '999'; 
	}
	else if (theLevel == "l2") {
		navToSave = navToSave + "_" + locArrayNav[2] + "_" + theNumber + "_" + '999'; 
	}
	else if (theLevel == "l3") {
		navToSave = navToSave + "_" + locArrayNav[2] + "_" + locArrayNav[3] + "_" + theNumber; 
	}
	setCookie('lastNav', navToSave);
}


// only called by home page
function saveAgeSexToCookie(theAge, theSex) { //5to7, 8to10, 11to13, boy, girl
	var locNav = theSex + "_" + theAge + "_" + "2_0_999";
//	var locNav = theSex + "_" + theAge + "_" + "999_999_999";
	setCookie('lastNav', locNav);
	askForVoucherNo();
}

function resetAgeSexCookies() {
	var indexForArrayOfAgeSexGroups = parseInt(document.forms[0].agegencategory.value);
	var locNav = arrayOfAgeSexGroups[indexForArrayOfAgeSexGroups][1] + "_" + arrayOfAgeSexGroups[indexForArrayOfAgeSexGroups][0] + "_" + "2_0_999";
	setCookie('lastNav', locNav);
	location.href="shop.html";
}






function initiateNavVariablesWhilePageLoads() { // called while loading by all product pages and shop.html
	var str = new String(getCookie('lastNav'));
	if (str == "") {
		alert("You need to enter the shop via our home page. Click OK to continue to our home page.");
		location.href="index.html";
	}
	else {
		var re = /_/;
			

		locArrayNav = str.split(re);
		thisPageCategoryIndexNo = parseInt(locArrayNav[2]);
		boyGirl = locArrayNav[0];
		theAge = locArrayNav[1];
		populateNavHTMLs();
	}
}









if(!Array.indexOf){
	Array.prototype.indexOf = function(obj){
	      for(var i=0; i<this.length; i++){
	          if(this[i]==obj){
	              return i;
	         }
	      }
	      return -1;
	  }
}









function populateNavHTMLs() {



	var searchFor = "";
	if ( theAge == "5to7" && boyGirl == "girl") { searchFor = "G1"; }
	else if ( theAge == "8to10" && boyGirl == "girl") { searchFor = "G2"; }
	else if ( theAge == "11to13" && boyGirl == "girl") { searchFor = "G3"; }
	else if ( theAge == "5to7" && boyGirl == "boy") { searchFor = "B1"; }
	else if ( theAge == "8to10" && boyGirl == "boy") { searchFor = "B2"; }
	else if ( theAge == "11to13" && boyGirl == "boy") { searchFor = "B3"; }

		


	l1NavHTML = '&nbsp;&nbsp;&nbsp;';


//	var howManyButtons = 0;
//	for (var i = 0; i < 50; i++) { // go through arraysCatsL1 array
//		var str = new String(arraysCatsL1[i])
//		var re = /___/;
//		var arrayOfStrSplit = str.split(re);
//		var linkTitle = arrayOfStrSplit[0]; // eg. Toys
//		var prodNo = arrayOfStrSplit[2]; // eg. 0001
//		if ( str.indexOf(searchFor) != -1) { // we need to show this category
//			howManyButtons += 1;
//		}
//	}
//	alert(howManyButtons)
	
	for (var i = 0; i < 50; i++) { // go through arraysCatsL1 array
		var str = new String(arraysCatsL1[i])
		var re = /___/;
		var arrayOfStrSplit = str.split(re);
		var linkTitle = arrayOfStrSplit[0]; // eg. Toys
		var prodNo = arrayOfStrSplit[2]; // eg. 0001
		if ( str.indexOf(searchFor) != -1) { // we need to show this category
			var letterForImage = "g";
			if (boyGirl == "boy") {
				letterForImage = "b"
			}
			if (i == thisPageCategoryIndexNo) { // we want to show buttonn highlighted
				l1NavHTML += '<a href="p_' + prodNo + '.html" onclick="saveNavCookie(\'l1\', \'' + i + '\')"><img src="images/' + linkTitle + '_' + letterForImage + '_on.png" alt=" ' + linkTitle + ' "></a>';
			}
			else {
				l1NavHTML += '<a href="p_' + prodNo + '.html" onclick="saveNavCookie(\'l1\', \'' + i + '\')"><img src="images/' + linkTitle + '_' + letterForImage + '_off.png" id="' + linkTitle + '" onmouseover="document.images[\'' + linkTitle + '\'].src=\'images/' + linkTitle + '_' + letterForImage + '_on.png\'" onmouseout="document.images[\'' + linkTitle + '\'].src=\'images/' + linkTitle + '_' + letterForImage + '_off.png\'" alt=" ' + linkTitle + ' "></a>';
			}
		}
	}
	l1NavHTML += '<br /><br />';




	var str = new String(getCookie('lastNav'));
	// alert(str);
	var re = /_/;
	locArrayNav = str.split(re);

	var lastL1clicked = parseInt(locArrayNav[2]); 
	var lastL2clicked = parseInt(locArrayNav[3]); 
	var lastL3clicked = parseInt(locArrayNav[4]); 




	l2NavHTML = '';
	var smallPicsToShow = "";

	if (lastL1clicked != 999) {
		var str11 = new String(arraysCatsL1[lastL1clicked]);
		var re11 = /___/;
		var arrayOfStrSplit11 = str11.split(re11);
		smallPicsToShow = arrayOfStrSplit11[3] // eg. 0001_0004_0007
	}


	if (lastL1clicked != 999) {
		for (var i = 0; i < 10; i++) { // go through arraysCatsL2[lastL1clicked] array
			var str = new String(arraysCatsL2[lastL1clicked][i]);
			var re = /___/;
			var arrayOfStrSplit = str.split(re);
			var linkTitle = arrayOfStrSplit[0]; // eg. Toys
			var prodNo = arrayOfStrSplit[2]; // eg. 0001

			if ( str.indexOf(searchFor) != -1) { // we need to show this L2 category
				if (lastL2clicked != 999 && lastL2clicked == i) {
					smallPicsToShow = arrayOfStrSplit[3] // eg. 0001_0004_0007
				}

				l2NavHTML += '<a class="level2" href="p_' + prodNo + '.html" onclick="saveNavCookie(\'l2\', \'' + i + '\')">' + linkTitle + '</a><br />';
				for (var j = 0; j < 10; j++) { // go through arraysCatsL3[lastL1clicked][i] array
					var str2 = new String(arraysCatsL3[lastL1clicked][i][j]);
					var re2 = /___/;
					var arrayOfStrSplit2 = str2.split(re2);
					var linkTitle2 = arrayOfStrSplit2[0]; // eg. Toys
					var prodNo2 = arrayOfStrSplit2[2]; // eg. 0001
					if ( str2.indexOf(searchFor) != -1) { // we need to show this L3 category
						l2NavHTML += '&nbsp;&nbsp;<a class="level3" href="p_' + prodNo2 + '.html" onclick="saveNavCookie(\'l2\', \'' + i + '\');saveNavCookie(\'l3\', \'' + j + '\')">- ' + linkTitle2 + '</a><br />';
						if (lastL3clicked != 999 && lastL2clicked == i && lastL3clicked == j) {
							smallPicsToShow = arrayOfStrSplit2[3] // eg. 0001_0004_0007 // overwrites lower L level
						}
					}	
				}
			}
		}
	}


	l2NavHTML += '<br /><br />';


	smallPics = '';
	var str7 = new String(smallPicsToShow);
	var re7 = /_/;
	var arrayOfSmallPics = str7.split(re7);

	var arrayOfSmallPicsAfterRemovingNoshows = new Array();

	

	for (var i = 0; i < arrayOfSmallPics.length; i++ ) { 



		if (boyGirl == "boy") {
			if (dontShowSmallPicsBoys.indexOf(arrayOfSmallPics[i]) == -1) {
				
				if (searchFor == "B1" && dontShowSmallPicsB1.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
				else if (searchFor == "B2" && dontShowSmallPicsB2.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
				else if (searchFor == "B3" && dontShowSmallPicsB3.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
			}
		}
		else if (boyGirl == "girl") {


			if ( dontShowSmallPicsGirls.indexOf(arrayOfSmallPics[i]) == -1) {
				if (searchFor == "G1" && dontShowSmallPicsG1.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
				else if (searchFor == "G2" && dontShowSmallPicsG2.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
				else if (searchFor == "G3" && dontShowSmallPicsG3.indexOf(arrayOfSmallPics[i]) == -1) {
					arrayOfSmallPicsAfterRemovingNoshows.push(arrayOfSmallPics[i])
				}
			}
		}
	}



	var oneToThreeCounter = 1;
	for (var i = 0; i < arrayOfSmallPicsAfterRemovingNoshows.length; i++ ) {

		if (arrayOfSmallPicsAfterRemovingNoshows[i] == thisProductNo) {
			smallPics += '<a href="p_' + arrayOfSmallPicsAfterRemovingNoshows[i] + '.html"><img class="selectedborder" src="images/products/' + arrayOfSmallPicsAfterRemovingNoshows[i] + 't.jpg" alt="' + arrayOfSmallPicsAfterRemovingNoshows[i] + '"></a>';
		}
		else {
			smallPics += '<a href="p_' + arrayOfSmallPicsAfterRemovingNoshows[i] + '.html"><img src="images/products/' + arrayOfSmallPicsAfterRemovingNoshows[i] + 't.jpg" alt="' + arrayOfSmallPicsAfterRemovingNoshows[i] + '"></a>';
		}
		if (oneToThreeCounter != 3) {
			smallPics += '&nbsp;&nbsp;';
		}
		if (oneToThreeCounter == 3) {
			smallPics += '<br />';
			oneToThreeCounter = 1;
		}
		else {
			oneToThreeCounter++;
		}
	}
	smallPics += '<br /><br />';

}







function knockOffSomeDecPlaces(expr, decplaces) {	
	var str = "" + Math.round (eval(expr) * Math.pow(10,decplaces));
	while (str.length <= decplaces) { str = "0" + str; }
	var decpoint = str.length - decplaces
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length);
}	






var t67;



function addToBasket(theProdNo) {

	var productQty = parseInt(document.forms[0].quantity.value);
	var basketArray = getCookie("basketCookie");
	// 0001_1___0010_5;

	var eitmStr = "___";
	if (basketArray == "") { //no items yet
		eitmStr = ""; // don't want on first item
	}
	basketArrayStr = new String(basketArray);
	basketArrayStr += eitmStr;
	basketArrayStr += theProdNo + "_" + productQty;
	setCookie("basketCookie", basketArrayStr);

	fillBasketDiv();

	addingtobasketwindow=dhtmlmodal.open('HamerNamingBox', 'div', 'addingtobasket', '', 'width=200px,height=150px,center=1,resize=0,scrolling=1')
	t67 = setTimeout("closeAddingToBasketWindow()",2000);

}




function fillBasketDiv() {


	var htmlForBasketDiv = "";

	var noOfItems = 0;
	var totalForAll = 0;

	var str = new String(getCookie("basketCookie"));
	// 0001_1___0005_5

	var basketArray = str.split("___");
	if (basketArray.length > 0 && basketArray[0] != "") {

		for (var i = 0; i < basketArray.length; i++) {
			var str2 = new String(basketArray[i])
			var tempArray =  str2.split("_");

			//tempArray[0] = item code
			//tempArray[1] = qty

			var thisUnitPrice = 0;
	
			for (var j = 0; j < arProds.length; j++ ) {
				if (arProds[j][0] == tempArray[0]) {
					thisUnitPrice = parseFloat(arProds[j][1]);
				}
			}

			totalForAll += thisUnitPrice*parseInt(tempArray[1]);
			noOfItems += parseInt(tempArray[1]);
			
		}

	}



	htmlForBasketDiv += '<div id="thebasketitems">' + noOfItems + ' item';
	if (noOfItems != 1) {
		htmlForBasketDiv += 's';
	}
	htmlForBasketDiv += '</div>';


	htmlForBasketDiv += '<div id="thebaskettotal">' +  knockOffSomeDecPlaces(totalForAll,2) + '</div>';


	htmlForBasketDiv += '<div id="otherlines">';
	if (valueOfVouchers > 0) {
		
		var leftToSpend = valueOfVouchers - totalForAll;
		htmlForBasketDiv += 'Vouchers value: &pound;' +  knockOffSomeDecPlaces(valueOfVouchers,2) + '<br />';

		if (leftToSpend >= 0) {
			htmlForBasketDiv += '<b>Left to spend: &pound;' +  knockOffSomeDecPlaces(leftToSpend,2) + '</b><br />';
		}
		else {
			var overSpend = totalForAll - valueOfVouchers;
			htmlForBasketDiv += 'You\'ve <b>overspent</b> by: &pound;' +  knockOffSomeDecPlaces(overSpend,2) + '<br />';
		}
	}

//	if (noOfItems > 0) {
//		htmlForBasketDiv += '<br /><a href="_shopping_basket.html">&gt;&gt; Go to my shopping basket</a></b><br />';
//	}
	htmlForBasketDiv += '</div>';



	htmlForBasketDiv += '<div id="clickforbasket"><a href="_shopping_basket.html"><img src="images/empty.gif" width="141" height="35" alt="Click for checkout" /></a></div>';


	document.getElementById("basket").innerHTML = htmlForBasketDiv;


}
	





var valueOfVouchers = 0;
function checkForVoucherNumbersInCookie(callingPage) {

	valueOfVouchers = 0;

	var str = new String(getCookie('voucherNumbers'));
	var htmlToReturn = "";

	if (typeof str != 'undefined' && str != '' ) {

		var re = /_/;
		locArray = str.split(re);

		var voucherNumbers = new Array();

		if (typeof locArray[0] != "undefined" && locArray[0] != '') {
			voucherNumbers.push(locArray[0]);
		}
		if (typeof locArray[1] != "undefined" && locArray[1] != '') {
			voucherNumbers.push(locArray[1]);
		}
		if (typeof locArray[2] != "undefined" && locArray[2] != '') {
			voucherNumbers.push(locArray[2]);
		}
		if (typeof locArray[3] != "undefined" && locArray[3] != '') {
			voucherNumbers.push(locArray[3]);
		}

		var onchangeStuff = "";

		if (callingPage == "basket") {
			onchangeStuff = ' onchange="processVouchersEtc(\'basket\')" ';
		}


		// dedupe vouchers
	
		var voucherNumbersTest = voucherNumbers;
		voucherNumbersTest.sort();
		var voucherNumbers2 = new Array();
		var lastVNo = 0;
		for (var i = 0; i < voucherNumbersTest.length; i++ ) { 
			if (voucherNumbers[i] != lastVNo) {
				voucherNumbers2.push(voucherNumbersTest[i])
				lastVNo = voucherNumbersTest[i];
			}
		}

		if (voucherNumbers2.length != voucherNumbersTest.length) { // we had a dupe
			voucherNumbers.length = 0;
			voucherNumbers = voucherNumbers2
		}




		var lastFilledBoxNo = 0;
		for (var i = 0; i < voucherNumbers.length; i++ ) {
			var thisNum = i + 1;
			lastFilledBoxNo = thisNum;
			htmlToReturn += 'Voucher ' + thisNum + ': <input id="vouch' + thisNum + '" type="text" name="vouch' + thisNum + '" size="30" value="' + voucherNumbers[i] + '"' + onchangeStuff + ' /><br /><br />';

			var thisVouchNum = new String(voucherNumbers[i]);
	
			// vouchers numbers should have an A,B etc followed by010, 050, 150 etc
			if (thisVouchNum.substring(1,4) == "010") { valueOfVouchers += 10; }
			else if (thisVouchNum.substring(1,4) == "015") { valueOfVouchers += 15; }
			else if (thisVouchNum.substring(1,4) == "025") { valueOfVouchers += 25; }
			else if (thisVouchNum.substring(1,4) == "035") { valueOfVouchers += 35; }
			else if (thisVouchNum.substring(1,4) == "050") { valueOfVouchers += 50; }
		}

		if (lastFilledBoxNo == 1) {
			for (var i = 2; i < 5; i++ ) {
				htmlToReturn += 'Voucher ' + i + ': <input id="vouch' + i + '" type="text" name="vouch' + i + '" size="30" value=""' + onchangeStuff + ' /><br /><br />';
			}
		}

		else if (lastFilledBoxNo == 2) {
			for (var i = 3; i < 5; i++ ) {
				htmlToReturn += 'Voucher ' + i + ': <input id="vouch' + i + '" type="text" name="vouch' + i + '" size="30" value=""' + onchangeStuff + ' /><br /><br />';
			}
		}
		else if (lastFilledBoxNo == 3) {
			htmlToReturn += 'Voucher ' + 4 + ': <input id="vouch' + "4" + '" type="text" name="vouch' + "4" + '" size="30" value=""' + onchangeStuff + ' /><br /><br />';
		}
	}
	else {
		for (var i = 1; i < 5; i++ ) {
			htmlToReturn += 'Voucher ' + i + ': <input id="vouch' + i + '" type="text" name="vouch' + i + '" size="30" value=""' + onchangeStuff + ' /><br /><br />';
		}

	}
	

	if (callingPage != "justupdatevouchertotal") {
		return htmlToReturn;
	}

}




function processVouchersEtc(callingPage) {

	var vouch1 = new String(document.getElementById("vouch1").value);
	var vouch2 = new String(document.getElementById("vouch2").value);
	var vouch3 = new String(document.getElementById("vouch3").value);
	var vouch4 = new String(document.getElementById("vouch4").value);


	vouch1 = vouch1.replace(/[^0-9A-Z]/gi, ''); 
	vouch2 = vouch2.replace(/[^0-9A-Z]/gi, ''); 
	vouch3 = vouch3.replace(/[^0-9A-Z]/gi, ''); 
	vouch4 = vouch4.replace(/[^0-9A-Z]/gi, ''); 


	var voucherNumbers = new String();
	if (vouch1 != "") {
		voucherNumbers += vouch1 + '_';
	}
	if (vouch2 != "") {
		voucherNumbers += vouch2 + '_';
	}
	if (vouch3 != "") {
		voucherNumbers += vouch3 + '_';
	}
	if (vouch4 != "") {
		voucherNumbers += vouch4 + '_';
	}
	if (voucherNumbers != "") {
		voucherNumbers = voucherNumbers.slice(0, - 1);
	}

	setCookie("voucherNumbers", voucherNumbers);

	if (callingPage == "basket") {
		checkForVoucherNumbersInCookie("justupdatevouchertotal");
		fillItemsDiv();

		addingtobasketwindow=dhtmlmodal.open('HamerNamingBox', 'div', 'addingtobasket', '', 'width=350px,height=200px,center=1,resize=0,scrolling=1')
		t67 = setTimeout("closeAddingToBasketWindow()",500);

	}

	else {
		location.href="shop.html";
	}
}




function askForVoucherNo() {
	//Open a modal window populated with the contents of a hidden DIV, and assign the result to a global variable called "vouchernumberwindow"
	vouchernumberwindow=dhtmlmodal.open('VoucherNumberBox', 'div', 'vouchernumber', '', 'width=350px,height=300px,center=1,resize=0,scrolling=1')
}



function closeAddingToBasketWindow() {
	addingtobasketwindow.hide();
}














