<!--
function addBookmark(title,url) {
	if (window.sidebar) {
  		window.sidebar.addPanel(title, url,"");
 	} else if( document.all ) {
 		window.external.AddFavorite( url, title);
 	} else if( window.opera && window.print ) {
 		return true;
	}
}

function printPopup() {
		var printUrl=document.location.href;
		if (printUrl.indexOf('#') > 0) printUrl = printUrl.substring(0,printUrl.indexOf('#'));
		if (printUrl.indexOf('?') > 0) printpop(printUrl + "&print=1");
		
		else printpop(printUrl + "?print=1");
	}

function notifyFriend(params)
			{
				var sLocation = document.location.href;
				if( sLocation.indexOf("?") == -1 ) sLocation ;
				else sLocation;
				if (params==null) params="";
				var s = "/notify_friend_window.xml";
					s += "?document_href=" + escape( sLocation );
					s += "&amp;" + params;
				window.open(s, 'notify_friend', 'width=458,height=382,menubar=no,resizable=no,left=' + ((window.screen.width - 320)/2 ) + ',top=' + ((window.screen.height - 300)/2 )).focus();  
			 }
			 
	function printpop(url) {
				var Win;
				if(window.screen)
				{
				aw = screen.availWidth;
				ah = screen.availHeight;
				}
				else
				{
				aw=640;
				ah=480;
				}
				Win=window.open(url,'print',"width=600, height=600,left=" +(aw-590)/2+",top=" +(ah-600)/2 + ",toolbar=no,location=no,directories=no," +"status=no,menubar=no," +"scrollbars=yes,resizable=no");
								
			}

function winPromoOpen(url) 
{
	var Win;
	if (Win) Win.close();
	Win = window.open("/js/promo-view.html?"+url,"photo","width=800, height=600, scrollbars=yes,resizable=yes,menubar=no,status=no");
}

			

function openNewWindow(url)
{
	openNewWindow(url, 480, 120, 'no', 'no');
} 

function openNewWindow(url, x, y, scrollbars, resizable)
{
 	 aPopUp = window.open('','VALLIST');	
 	 aPopUp.close();
 	 var left = (screen.availWidth/2) - (x/2);
	 var top = (screen.availHeight/2) - (y/2);
 	
    aPopUp= self.window.open(url,'VALLIST','toolbar=no,location=no,directories=no,status=yes,scrollbars='+scrollbars+',resizable='+resizable+', copyhistory=no,width='+x+',height='+y+',top='+top+',left='+left);
    self.aNoteWin = aPopUp;
} 			
			

	
function addToCardWithServices(prodId,prodTitle, services, msg) {

		if (!document.getElementById('basket-small')) {
			document.location.href = '/add-to-cart.bhtml?prod_id='+prodId;
			return false;
		}
		
		new Ajax.Request('/add-and-refresh-cart.bhtml', 
		{ 
			method:'post', 
			parameters: {productId: prodId, serviceItem: services},
			onSuccess: function(transport){
				document.getElementById('basket-small').innerHTML = transport.responseText;      				
  				showNotify(prodTitle, msg);      				
			},
			onFailure: function() { 
				
			}
		});
	
	return false;
}			
			
function addToCard(variantId,variantTitle) {

		if (!document.getElementById('basket-small')) {
		
			document.location.href = '/add-to-cart.bhtml?variant_id='+variantId;
			return false;
		}
		
		new Ajax.Request('/add-and-refresh-cart.bhtml', 
		{ 
			method:'post', 
			parameters: {pVariantId: variantId},
			onSuccess: function(transport){
				document.getElementById('basket-small').innerHTML = transport.responseText;      				
  				showNotify(variantTitle, '');      				
			},
			onFailure: function() { 
				
			}
		});
	
	return false;
}
	
function hideNotify() {
	node = document.getElementById('alertLayer')
	if (node) {
		document.getElementById("top").removeChild(node);
	}
}	
	
function showNotify(prodTitle, msg) {

	height = (navigator.appName.indexOf("Netscape") != -1) ? pageYOffset + (innerHeight/2) - 100 : (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop) + ((window.screen.height-200)/2) - 100;

	hideNotify();	
	notifyLayer = document.createElement('div')
	notifyLayer.id = "alertLayer";
	notifyLayer.onclick = function () {hideNotify();};
	notifyLayer.style.height =((navigator.appName.indexOf("Netscape") != -1) ? pageYOffset + innerHeight: (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop) + window.screen.height-200) +'px';

	notify = document.createElement('div')
	notify.id = "addToCartAlert";


	ifr = document.createElement('iframe');
	ifr.id = "alertIfr";
	ifr.frameBorder = "0";
	ifr.style.marginTop = height+'px';
	ifr.setAttribute('allowtransparency',true);

	pClose = document.createElement('img');
	pClose.src="/images/www/spacer.gif"
	pClose.id = "closeAlert";
	pClose.onclick = function() {hideNotify();};
	
	
	pIntro = document.createElement('p');
	pIntroText = document.createTextNode('Added to your basket:');
	pIntro.appendChild(pIntroText);

	pContener = document.createElement('div');
	pContener.id="alertContener";
	
	pProd = document.createElement('h2');
	pProd.id = "alertProdTitle"
	pProd.innerHTML = prodTitle;

	pInputCont = document.createElement('span');
	pInputCont.className = 'more';
	pInputCont.onclick=function() {hideNotify();};
	pInputText = document.createTextNode('Continue shopping');
	pInputCont.appendChild(pInputText);
	
	pCartLink = document.createElement('a');
	pCartLink.className = 'more more_red';
	pCartLink.href = '/cart.bhtml';
	pCartText = document.createTextNode('Go to Checkout');
	pCartLink.appendChild(pCartText);
	
	notify.appendChild(pClose);
	notify.appendChild(pIntro);
//	notify.appendChild(pProd);
	pContener.appendChild(pProd);
	for(var j=0; j < msg.length; j++) {
		pService = document.createElement('h2');
		pService.id = "alertProdTitle"
		pServiceText = document.createTextNode(msg[j]);
		pService.appendChild(pServiceText);
		pContener.appendChild(pService);
	}	
	notify.appendChild(pContener);
	notify.appendChild(pInputCont);
	notify.appendChild(pCartLink);
	notifyLayer.appendChild(ifr);
	notifyLayer.appendChild(notify);
	

	document.getElementById("top").appendChild(notifyLayer);	
	document.getElementById("container").onclick = function() {hideNotify();};
}
			
			
function showPhoto(midi, maxi, el) {

	ml = document.getElementById('medium-link');
	ml.onclick=function() { return winGalleryOpen('/photo/'+maxi);};

	mp = document.getElementById('medium-photo');
	mp.src='/photo/'+midi;
	mp.onclick=function() {winGalleryOpen('/photo/'+maxi);};

	thumbs = document.getElementById('add-photos').childNodes;
	for (i=0; i<thumbs.length; i++) {
		if(thumbs[i]==el) thumbs[i].className='photoswitch  photoactive';
		else thumbs[i].className='photoswitch';
	}

	return false;

}

function createCookie(name,value)
{
	var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
			
	function createCookie(name,value,days)
	{
		if (days)
		{
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	function eraseCookie(name)
	{
		createCookie(name,"",-1);
	}			
		
	function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
	
			

		
	function trimFieldProductNumber(form) {
		var str = form.productNumber.value;
		while (str.substring(0,1) == ' ')
			str = str.substring(1, str.length);
		while (str.substring(str.length-1, str.length) == ' ')
			str = str.substring(0,str.length-1);
		form.productNumber.value=str;
	}
	function checkProductNumber(form) {
		trimFieldProductNumber(form);
		if (!form.productNumber.value || form.productNumber.value.length==0) { alert('Please input product number'); return false; }
		return true;
	}	
	
	function trimField(form) {
		var str = form.keyword.value;
		while (str.substring(0,1) == ' ')
			str = str.substring(1, str.length);
		while (str.substring(str.length-1, str.length) == ' ')
			str = str.substring(0,str.length-1);
		form.keyword.value=str;
	}
	function checkWord(form) {
		trimField(form);
		return true;
	}		
			
//-->