$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'facebook'});

	
	//CLICKABLE Items
	$(".clickable")
		.click(function(){
			location = $(this).find("a:first").attr("href");
		})
		.mouseover(function(){
			var parent = $(this);
			var child = $(".submenu", parent);
			var pos = parent.position();
			child.css("top", "343px");
			child.css("left", pos.left + "px");
			child.show();
		})
		.mouseout(function(){
			var parent = $(this);
			var child = $(".submenu", parent);
			parent.toggleClass("hover");
			child.hide();
		});
		
//	$(".submenu").mouseout(function(){
//		$(this).hide();
//	});
	
});

function fnPopup(url)
{
	var	W = 600;
	var H = 450;
	var L = (screen.width - W) / 2;
	var T = (screen.height - H) / 2;
	day = new Date();
	id = day.getTime();
	url = 'popup.asp?img=' + url;
	eval("page" + id + " = window.open('" + url + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+W+',height='+H+',left ='+L+',top ='+T+'');");
}
function fnLoginFirst() {
	alert('Please login at My Derco');
}
function fnWeldingInformation() {
	alert('Please contact Derco for detailled welding information.');
}
function fnPdf(url)
{
	var	W = 700;
	var H = 700;
	var L = (screen.width - W) / 2;
	var T = (screen.height - H) / 2;
	day = new Date();
	id = day.getTime();
	url = 'pdf.asp?pdf=' + url;
	eval("page" + id + " = window.open('" + url + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+W+',height='+H+',left ='+L+',top ='+T+'');");
}
function checkLogin(form)
{
	if ( (form.txtUsername.value != "") && (form.txtPassword.value != "") )
		form.submit();
	else
		alert('Vul een klantnummer en wachtwoord in');
}

function countResults()
{
	alert("?");
	var oFrm = eval("document.forms.AdvancedSearch");

	var prod = oFrm.selProdType[oFrm.selProdType.selectedIndex].value;
	var belt = oFrm.selTypeBelt[oFrm.selTypeBelt.selectedIndex].value;
	var color = oFrm.selColor[oFrm.selColor.selectedIndex].value;
	var layer = oFrm.selLayers[oFrm.selLayers.selectedIndex].value;
	var cover = oFrm.selCover[oFrm.selCover.selectedIndex].value;
	var profile = oFrm.selProfile[oFrm.selProfile.selectedIndex].value;

	window.frames.fraCode.location.href = "xt_countResults.asp?prod=" + prod + "&belt=" + belt + "&color=" + color + "&layer=" + layer + "&cover=" + cover + "&profile=" + profile;
}
