//Script: exclusive-surray.js

<!-- head-tags --->
/* var review_url='http://build.exclusiveconcepts.com/yahoo-stores/write-review-form.php?store_id=luggageandgifts&prod_id='; */
var review_url='http://www.secure-ecommerce-services.com/storeservices/bms/yahoo-stores/write-review-form.php?store_id=luggageandgifts&prod_id=';

function write_review(prod_id, productname) {
	var url=review_url+prod_id+'&productname='+productname;
	var popWin = window.open(url,'review','width=387,height=507,scrollbars=yes,toolbar=no,location=no');
	popWin.opener.top.name="opener";
	popWin.focus();
}

function openWindow (url,name,widgets) {
	popupWin = window.open (url,name,widgets);
	popupWin.opener.top.name="opener";
	popupWin.focus();
}

function mailpage() {
	mail_str = "mailto:?subject=Check out the " + document.title;
	mail_str += "&body=I thought you might be interested in the " + document.title;
	mail_str += ". You can view it at, " + location.href; 
	location.href = mail_str;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	var url=theURL+"?referrer="+location.href+"&title="+document.title;
	window.open(url,winName,features);
}

function MM_swapImgRestore() {
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function brandex_select() {
	location=document.frm.brandex.options[document.frm.brandex.selectedIndex].value;
}

function priceex_select() {
	location=document.frm1.priceex.options[document.frm1.priceex.selectedIndex].value;
}

function getCheckValuesS(checkBoxArray) {
	var a=checkBoxArray.length;
	var tempString = "id[]=";
	var counter = 0;
	for (i = 0; i < a; i++) {
		if (checkBoxArray[i].checked) {
			if (counter > 0) tempString +="&id[]=";
			tempString += checkBoxArray[i].value;
			counter++;
		}
	}
	if (counter==0)
		alert("You have not chosen any product to compare. Please choose two products to compare.");
	else if(counter==1)
		alert("You have chosen only one product to compare. Please choose two products to compare.");
	else
		document.location=("http://www.surrayluggage.com?"+tempString);
}

function readCookie(name) {
	var cookieValue = "";
	var search = name + "=";
	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;
			cookieValue = unescape(document.cookie.substring(offset, end));
		}
	}
	return cookieValue;
}

function showprdImage(console, img) {
	document.getElementById(console).src=img;
}

function PopUpWarranty(url,est) {
	var urlwarranty=url+'.html';
	window.open(urlwarranty,'warranty','width=400,height=200');
}
<!-- head-tags ends --->
				
<!-- Exclusive-popup-script -->
							
function popUpWindow(URLStr, _left, _top, _width, _height) {
	///var width=_width||"600", height=_height||"400";
	///var left = _left || ((screen.width/2) - width/2);
	///var top = _top || ((screen.height/2) - height/2 );
	
	//popUpWin = open(URLStr, 'popUpWin');
	location.replace(URLStr);
}

<!-- Exclusive-popup-script ends -->
							
function SubmitFunction(frm) {
	var obj=document.getElementById(frm);
	var selected_opt = false;
	var url="exclusive-wizard-test.html?auto=1";
	
	if(obj.cboWhat.selectedIndex > 0)  {url+="&c1="+obj.cboWhat.selectedIndex; selected_opt = true;}
	if(obj.cboWho.selectedIndex > 0)   {url+="&c2="+obj.cboWho.selectedIndex;  selected_opt = true;}
	if(obj.cboWhy.selectedIndex > 0)   {url+="&c3="+obj.cboWhy.selectedIndex;  selected_opt = true;}
	if(obj.cboWhen.selectedIndex > 0)  {url+="&c4="+obj.cboWhen.selectedIndex; selected_opt = true;}
	if(obj.cboBrand.selectedIndex > 0) {url+="&c5="+obj.cboBrand.selectedIndex;selected_opt = true;}
	if(obj.cboPrice.selectedIndex > 0) {url+="&c6="+obj.cboPrice.selectedIndex;selected_opt = true;}

	if( selected_opt == false) {
		alert('Select some options');
		return false;
	}
		popUpWindow(url);
}

<!-- Exclusive-getstarrating -->

function GetStarRating(product) {
	/*document.write('<scr'+'ipt src="http://build.exclusiveconcepts.com/yahoo-stores/get-star-rating.php?type=3&store_id=luggageandgifts&prod_id='+product+'"><scr'+'ipt>');
	*/
	document.write('<scr'+'ipt src="http://www.secure-ecommerce-services.com/storeservices/bms/yahoo-stores/get-star-rating.php?type=3&store_id=luggageandgifts&prod_id='+product+'"><scr'+'ipt>');
}

<!-- Exclusive-getstarrating ends -->

<!-- Exclusive-help-wizard-initiator -->

function WandTheMagic(frmObj, console, _showAll) {
	var showAll=_showAll || 0;
	var frmObj= document.getElementById(frmObj);
	//initialize list
	var productsToFilter = new ProductsToFilter();
	productsToFilter.init(Items);

	//apply filter
	if(frmObj.cboWhat.value!="") 	productsToFilter.AddFilterParam("Producttype:"+frmObj.cboWhat.value);
	if(frmObj.cboWho.value!="")		productsToFilter.AddFilterParam("Customertype:"+frmObj.cboWho.value);
	if(frmObj.cboWhy.value!="")		productsToFilter.AddFilterParam("Use:"+frmObj.cboWhy.value);
	if(frmObj.cboWhen.value!="") 	productsToFilter.AddFilterParam("Occasion:"+frmObj.cboWhen.value);
	if(frmObj.cboBrand.value!="")	productsToFilter.AddFilterParam("Brand:"+frmObj.cboBrand.value);
	if(frmObj.cboPrice.value!="")	productsToFilter.AddFilterParam("Price:"+frmObj.cboPrice.value);

	productsToFilter.ApplyFilter();
	productsToFilter.CalculateWeightage();
	
	NumberOfItemsPerPage('12');
}

<!-- Exclusive-help-wizard-initiator  ends -->

<!-- rating-scripts -->	
							
var store_id='luggageandgifts';
<!-- var global_url='http://build.exclusiveconcepts.com/yahoo-stores/get-star-rating.php'; -->

var global_url='http://www.secure-ecommerce-services.com/storeservices/bms/yahoo-stores/get-star-rating.php';
function PopulateRatingBox(product_id) {
	var content;
	content="<script src=\""+global_url+"customer-reviews.php?type=1&store_id="+store_id+"&pro_id="+product_id+"\"><\/script>";
	document.write(content);
}

var hidden=true;
function toggle_reviews() {
	var review_list=document.getElementById("review_list");
	var toggler=document.getElementById("review_toggler");
	if(hidden==true) {
		review_list.style.display='block';
		toggler.innerHTML='Hide All Reviews';
		hidden=false;
	} else {
		review_list.style.display='none';
		toggler.innerHTML='See All Reviews';
		hidden=true;
	}
}

<!-- rating-scripts ends -->

<!-- Exclusive-getstarrating -->
							
function GetStarRating(product) {
	<!-- document.write('<scr'+'ipt src="http://build.exclusiveconcepts.com/yahoo-stores/get-star-rating.php?type=3&store_id=luggageandgifts&prod_id='+product+'"><scr'+'ipt>'); -->
	document.write('<scr'+'ipt src="http://www.secure-ecommerce-services.com/storeservices/bms/yahoo-stores/get-star-rating.php?type=3&store_id=luggageandgifts&prod_id='+product+'"><scr'+'ipt>');
}

function checkValidity(elm) {
	for(var i=0; i<elm.elements.length; i++) {
		if(elm.elements[i].type == "select-one") {
			if(elm.elements[i].value.toLowerCase() == "select a color") {
				alert("You must select a color");
				return false;
			} else  if(elm.elements[i].value.toLowerCase() == "select a size") {
				alert("You must select a size");
				return false;
			}
		}
	}
	return true;
}

<!-- Exclusive-getstarrating ends -->