// JavaScript Document
	image0 = new Image();
	image0.src = "images/bg_html.jpg";

	$(document).ready(function() {
	   
	   
	   $("span.lang a").click(function(){
			  alert('Coming soon!');
			  return false
		 })
	   
	  $('#body3558 li#menu3557, #body3558 li#menu3558').addClass('active');
	  $('#body3564 li#menu3557, #body3564 li#menu3564').addClass('active');
	  $('#body3565 li#menu3557, #body3565 li#menu3565').addClass('active');
	  $('#body3566 li#menu3557, #body3566 li#menu3566').addClass('active');
	  $('#body3567 li#menu3557, #body3567 li#menu3567').addClass('active');
	  $('#body3568 li#menu3557, #body3568 li#menu3568').addClass('active');
	  
	  // $("ul.items li a").prettyPhoto({theme:'facebook'}); 

		  $('#expendable').makeFAQ({
			  indexTitle: "My Index",
			  displayIndex: false,
			  faqHeader: "h5"
		  });
		  
		  $("a.delcart").click(function(){
			   var theID = this.rel ;					 
			   var theDivID = "#datarow" + theID ;	
			   $(theDivID).fadeOut('slow');
			   $.post("ajax/cart.asp", { formaction: "delcart", idcart: theID } );
			   return false
			})
		  


                 //thickbox replacement
				  var closeModal = function(hash)
				  {
					  var $modalWindow = $(hash.w);
			  
					  //$('#jqmContent').attr('src', 'blank.html');
					  $modalWindow.fadeOut('2000', function()
					  {
						  hash.o.remove();
						  //refresh parent
			  
						  if (hash.refreshAfterClose === 'true')
						  {
			  
							  window.location.href = document.location.href;
						  }
					  });
				  };
				  var openInFrame = function(hash)
				  {
					  var $trigger = $(hash.t);
					  var $modalWindow = $(hash.w);
					  var $modalContainer = $('iframe', $modalWindow);
					  var myUrl = $trigger.attr('href');
					  var myTitle = $trigger.attr('title');
					  var newWidth = 0, newHeight = 0, newLeft = 0, newTop = 0;
					  $modalContainer.html('').attr('src', myUrl);
					  //$('#jqmTitleText').text(myTitle);
					  myUrl = (myUrl.lastIndexOf("#") > -1) ? myUrl.slice(0, myUrl.lastIndexOf("#")) : myUrl;
					  var queryString = (myUrl.indexOf("?") > -1) ? myUrl.substr(myUrl.indexOf("?") + 1) : null;
			  
					  if (queryString != null && typeof queryString != 'undefined')
					  {
						  var queryVarsArray = queryString.split("&");
						  for (var i = 0; i < queryVarsArray.length; i++)
						  {
							  if (unescape(queryVarsArray[i].split("=")[0]) == 'width')
							  {
								  var newWidth = queryVarsArray[i].split("=")[1];
							  }
							  if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'height')
							  {
								  var newHeight = queryVarsArray[i].split("=")[1];
							  }
							  if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'jqmRefresh')
							  {
								  // if true, launches a "refresh parent window" order after the modal is closed.
			  
								  hash.refreshAfterClose = queryVarsArray[i].split("=")[1]
							  } else
							  {
			  
								  hash.refreshAfterClose = false;
							  }
						  }
						  // let's run through all possible values: 90%, nothing or a value in pixel
						  if (newHeight != 0)
						  {
							  if (newHeight.indexOf('%') > -1)
							  {
			  
								  newHeight = Math.floor(parseInt($(window).height()) * (parseInt(newHeight) / 100));
			  
							  }
							  var newTop = Math.floor(parseInt($(window).height() - newHeight) / 2);
						  }
						  else
						  {
							  newHeight = $modalWindow.height();
						  }
						  if (newWidth != 0)
						  {
							  if (newWidth.indexOf('%') > -1)
							  {
								  newWidth = Math.floor(parseInt($(window).width() / 100) * parseInt(newWidth));
							  }
							  var newLeft = Math.floor(parseInt($(window).width() / 2) - parseInt(newWidth) / 2);
			  
						  }
						  else
						  {
							  newWidth = $modalWindow.width();
						  }
			  
						  // do the animation so that the windows stays on center of screen despite resizing
						  $modalWindow.css({
							  width: newWidth,
							  height: newHeight,
							  opacity: 0
						  }).jqmShow().animate({
							  width: newWidth,
							  height: newHeight,
							  top: newTop,
							  left: newLeft,
							  marginLeft: 0,
							  opacity: 1
						  }, 'slow');
					  }
					  else
					  {
						  // don't do animations
						  $modalWindow.jqmShow();
					  }
			  
				  }
			  
				  $('#modalWindow').jqm({
					  overlay: 70,
					  modal: true,
					  trigger: 'a.thickbox',
					  target: '#jqmContent',
					  onHide: closeModal,
					  onShow: openInFrame
				  });
	  


	  });

function initNav()
{
	var nav = document.getElementById("cssmw");
	if(nav)
	{
		var lis = nav.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				for (var j=0; j<lis.length; j++)
				{
					if(lis[j].className.indexOf("active") != -1 && lis[j].className.indexOf("hide") == -1)
						lis[j].className += " hide";
				}
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				for (var j=0; j<lis.length; j++)
				{
					lis[j].className = lis[j].className.replace("hide", "");
				}
				this.className = this.className.replace("hover", "");
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initNav, false);
else if (window.attachEvent)
	window.attachEvent("onload", initNav);
	



function hideFormText() {
	var _inputs = document.getElementsByTagName('input');
	var _txt = document.getElementsByTagName('textarea');
	var _value = [];
	
	if (_inputs) {
		for(var i=0; i<_inputs.length; i++) {
			if (_inputs[i].type == 'text' || _inputs[i].type == 'password') {
				
				_inputs[i].index = i;
				_value[i] = _inputs[i].value;
				
				_inputs[i].onfocus = function(){
					if (this.value == _value[this.index])
						this.value = '';
				}
				_inputs[i].onblur = function(){
					if (this.value == '')
						this.value = _value[this.index];
				}
			}
		}
	}
	if (_txt) {
		for(var i=0; i<_txt.length; i++) {
			_txt[i].index = i;
			_value['txt'+i] = _txt[i].value;
			
			_txt[i].onfocus = function(){
				if (this.value == _value['txt'+this.index])
					this.value = '';
			}
			_txt[i].onblur = function(){
				if (this.value == '')
					this.value = _value['txt'+this.index];
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", hideFormText, false);
else if (window.attachEvent)
	window.attachEvent("onload", hideFormText);
