jQuery(function($) { 
	
	//Search
	$('#search .input-text').hint();
	
	//Nav
	var $nav = $('#nav');
	var $level1 = $('>ul', $nav);
	var $level1li = $('>li', $level1);
	var $level2 = $('>ul', $level1li);
	
	$level1li.each(function(i){
		switch (i){
			case 1:
			case 3:
			case 4:
			case 6: $(this).addClass('long');
		}
	});
	
	if (($.browser.msie) && ($.browser.version <= 6)) {
		var li = $('#nav > ul > li')
		li.hover(function(){ $(this).addClass('over')}, function(){ $(this).removeClass('over')});		
	}
	
	/*$level1
		.mouseenter(
			function(){
				var max = 0;
				$level2.each(function(i){
					_height = $(this).height();
					max = (_height>max)?_height:max;
				});
				$level2.height(max);
				$level2.show();
			}
		)
		.mouseleave(
			function(){
				$level2.hide();
			}
		);
		
	$level1li
		.mouseenter(
			function(){
				$(this).addClass('active');	
			}
		)
		.mouseleave(
			function(){
				$(this).removeClass('active');	
			}
		)*/
	
	//Subnav
	$('#subnav li:last-child').addClass('last-child');
	
	// custom selects
	if($('.filtersProjects select')[0]){
		$('.filtersProjects select').selectbox();
	}

	//Odd Class for teasers
	$('#list-new').find('li:even').addClass('even')

//home boxes
$('.home-border-box a.homeBoxLink:odd').css({"margin-right":"0"});

//job list


$('.vacanciesList tr').click(function(){document.location.href=$(this).find('.singleLink a').attr('href');});

	/*
	 * Slideshow
	 */
	if($('#slideshow-inner')[0]){
		$('#slideshow-inner').cycle({
			fx:      'scrollHorz',
			prev:    '#prevSlide',
			next:    '#nextSlide'
		});
		
		$('#pauseSlide').click(function() { 
    		    $('#slideshow-inner').cycle('pause');
				$(this).toggle()
				$('#playSlide').toggle();
		    	return false;
		});
		
		$('#playSlide').click(function() { 
    		    $('#slideshow-inner').cycle('resume');
				$(this).toggle()
				$('#pauseSlide').toggle();
				return false;
		});
	}

	
});

jQuery.noConflict();

function PrintLink() {
	var url = document.location.href;  
	var newurl = url;
	if ( url.indexOf("?") > -1 ) newurl = newurl+'&typeP=1';
	else  newurl = newurl+'?typeP=1';
	
	window.open(newurl,'PrintPage','menubar=1,scrollbars=1,width=730,height=680');
}

function printpr()
{
var OLECMDID = 7;
/* OLECMDID values:
* 6 – print
* 7 – print preview
* 1 – open window
* 4 – Save As
*/
var PROMPT = 1; // 2 DONTPROMPTUSER
var WebBrowser = '';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = '';
}
