/* PIPELINER WEBSITE js */$(document).ready(function() {  	// DROP DOWN MENUS	// correct the width of dropdown menus/*	$("ul.mainmenu-second-level").each(function(i){		var ow = $(this).parent().width() - 16;		$(this).css('width','auto');		$(this).css('min-width',ow);		$(this).children("li").css('width','auto');		$(this).children("li").css('min-width',ow);		$(this).find("a").css('width',ow);	});*/	$('ul.sf-menu').supersubs({             minWidth:    12,   // minimum width of sub-menus in em units             maxWidth:    27,   // maximum width of sub-menus in em units             extraWidth:  1     // extra width can ensure lines don't sometimes turn over                                // due to slight rounding differences and font-family         }).superfish({		delay:       0,		speed:       0,                     		autoArrows:  false,		dropShadows: true,		onBeforeShow: function(){			if ($(this).hasClass('mainmenu-third-level')) {				$(this).css('left', $(this).parent().width())			}		}	}); 						   	$('ul.sf-menu li ul').hide();		$('li').has('ul').addClass('hasSubmenu');	$('ul.sf-menu > li').hover( 		function () {			$(this).children('ul').show();		},		function () {			$(this).children('ul').hide();		}	);	$('a').each( function() {		if ($(this).attr("href") && ($(this).attr("href").indexOf("login-tb")>=0 || $(this).attr("href").indexOf("login_tb")>=0) && !($(this).hasClass("thickbox") || $(this).hasClass("iframe")))			tb_init(this);	});		// FANCY BOX	$('a.zoomable').fancybox();		// BOOKMARK - ADD TO FAVOURITES	$("#btnAddToFavorites").jFav(); 	// PRINT PAGE	$("#print").click(function(){window.print();return false;}); 		// LANGUAGE FLAGS DESCRIPTION	$("#lang-flags a").hover(		function () {			$('#lang-flags .lang-description').stop(true, true);			$('#lang-flags .lang-description').text( $(this).attr("title") );			$('#lang-flags .lang-description').fadeIn('fast');		}, 		function () {			$('#lang-flags .lang-description').fadeOut('fast');			$('#lang-flags .lang-description').text("");		}	);		// QSEARCH INPU TEXT 	$("#qsearch input[name=sword]").focus( 		function() {			if ($(this).val() == $(this).attr('title')) {				$(this).val("");			}		}	);	$("#qsearch input[name=sword]").focusout( 		function() {			if ($(this).val() == "") {				$(this).val($(this).attr('title'));			}		}	);		// THICKBOX POPUPS	$("a.thickbox").each(function(i){		if ( ! $(this).is('.bookmark') && !  $(this).is('.inline') ) // Do NOT apply to bookmark button		{			/*var L = parseInt(get_url_param('L'));			if ( L > 0 ) {				L = 'L='+L+'&';			} else {				L = '';			}*/			var href = $(this).attr('href');			if ( href.indexOf('?') > 0 ) {				href += "&amp;";			} else {				href += "?";			}			if ( href.indexOf('?')==-1 ) {				href += "?";			}			//if ( $(this).is('.inline') ) href += "height=300&width=300";			var pid = parseInt( $("#pid").text() );			if ( $(this).is('.iframe') ) {                href += "pid="+pid+"&amp;TB_iframe=true&amp;height=200&amp;width=720";    			$(this).attr('href',href);            }		}	});		// SOCIAL BOOKMARKS	$('.addthis_toolbox span').click(function() {		var $marginLefty = $(this).parent();		$marginLefty.animate({		  marginLeft: parseInt($marginLefty.css('marginLeft'),10) == 0 ?			$marginLefty.outerWidth()-38 :			0		});	});	$('#content-con').click(function() {		var $marginLefty = $('.addthis_toolbox');		$marginLefty.animate({		  marginLeft: $marginLefty.outerWidth()-38		});	});	        // search hack    $(".search-input-correct").parent().addClass("search-correct");		})// SAFARI FORGOT PASSWORD TB FIX - initiated from windowed_pages.jsfunction setTBheight(height) {	$('iframe').height(height);}function superchallenge_pass(form) {	var pass = form.pass.value;	if (pass) {		var enc_pass = MD5(pass);		var str = form.user.value+":"+enc_pass+":"+form.challenge.value;		form.pass.value = MD5(str);		return true;	} else {		return false;	}}var pw_change = 0;function enc_form(form) {	var pass = form['FE[fe_users][password]'].value;	var pass_again = form['FE[fe_users][password_again]'].value;	if ( pw_change ) {		if ( pass != pass_again || (pass.length!=0 && pass_again.length!=0 && pass.length<5 ) ) {			return false;		} else {		 if ( pass.length!=0 && pass_again.length!=0 ) {			var enc_pass = MD5(pass);			form['FE[fe_users][password]'].value = enc_pass;			form['FE[fe_users][password_again]'].value = enc_pass;		  }		}	}	return true;}