// JavaScript Document
<!--

function loadLogin(){

	ajax_loadContent('user','/applets/showuser.php');

}



function starrating(id){
	ajax_loadContent("product_rating","/applets/productview.rateproduct.php?prod_id="+id);
}


function content(page,limit,str, orderBy)
{
	if (orderBy == undefined)
	{
		ajax_loadContent('content',"/search/index.php?search_str="+str+"&limit="+limit+"&page="+page+"&orderBy=price_low");
	}
	else
	{
		ajax_loadContent('content',"/search/index.php?search_str="+str+"&limit="+limit+"&page="+page+"&orderBy="+orderBy);
	}

}


function content_catview(page,limit,cid,orderBy)
{
	if (orderBy == undefined)
	{
		ajax_loadContent('content',"/catview.php?cid="+cid+"&limit="+limit+"&page="+page);
	}
	else
	{
		ajax_loadContent('content',"/catview.php?cid="+cid+"&limit="+limit+"&page="+page+"&orderBy="+orderBy);
	}
}



function do_signin()
	{

	seed =  new Date().getTime();
	ajax_loadContent('user','/applets/showuser.php?seed=' + seed + '&event=signin&username=' + document.signin_form.username.value + '&password=' + document.signin_form.password.value);



}

function refreshbag(){

}

$(document).ready(function() {
	//Dropdown menu
	$('div.submenu> h6').click(function() {
		$('.sf-menu1').hide();
	});

	$('.sf-menu').mouseover(function(){
		$('.sf-menu1').show();
	});



	//for image gallery on full details page for product
	$(".imgGallery img").click(function() {
    	$(".imgGallery .mid img").attr("src", $(this).attr("rel"));
    	$(".thickbox").attr("href", $(this).attr("name"));
	});




		// When a link is clicked for the tab menu if you view full product details
		$("a.tab").click(function () {


			// switch all tabs off
			$(".active").removeClass("active");

			// switch this tab on
			$(this).addClass("active");

			// slide all content up
			$(".content").hide();

			//alert($(this));
			// slide this content up
			var content_show = $(this).attr("name");
			$("#"+content_show).show();

		});


		$("#wedrigs").click(function() {
			$(".hideshow").toggle();
		});

		$("#wedrigsman").click(function() {
			$(".hideshowman").toggle();
		});

});


    $(document).ready(function(){
        $("ul.sf-menu").superfish({
			firstOnClick: true,
			speed:         'normal',
			dropShadows: false,
			delay:       0

		});
    });

<!--
  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }//-->
  
  function send_mail(){
		if (document.frmService.sltProvince.value=="0"){
			alert("Please select your Province.");
			document.frmService.sltProvince.focus();
		} else if (document.frmService.txtInvoice.value==""){
			alert("Please enter your Invoice number.")
			document.frmService.txtInvoice.focus();
		} else if (document.frmService.txtName.value==""){
			alert("Please enter your Name.")
			document.frmService.txtName.focus();
		} else if (document.frmService.txtTelephone.value==""){
			alert("Please enter your Telephone number.")
			document.frmService.txtTelephone.focus();
		} else if ((document.frmService.txtEmail.value.search("@")==-1) || (document.frmService.txtEmail.value.search("[.*]")==-1)){
			alert("Please type in a valid Email address");
			document.frmService.txtEmail.focus();
		} else if (document.frmService.txtDescription.value==""){
			alert("Please enter a Description of the fault.");
			document.frmService.txtDescription.focus();
		} else {
			document.frmService.action = "/servicecentre/index.php";
			document.frmService.submit();
		}
	}



//-->