// JavaScript Document
$(document).ready(function(){
	
	if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent) || /Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Opera/x.x or Opera x.x (ignoring remaining decimal places);
		var oprversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		$('.super-container').css('overflow','hidden');
		$('#header').css('overflow','visible');
	}
	
	if($.browser.safari){
		$('.super-container').css('overflow','hidden');
		$('#header').css('overflow','visible');
	}
	
	//JAVASCRIPT CHOSEN FOR RESPONSIVE NAVIGATION
	$(".chosen").chosen();	
	
	//SUPERFISH FOR MAIN NAVIGATION
	$("ul.sf-menu").superfish(); 
	
	//RESPONSIVE SLIDER
	$('.flexslider').flexslider({
		animation: "slide",              //String: Select your animation type, "fade" or "slide"
		slideDirection: "horizontal",   //String: Select the sliding direction, "horizontal" or "vertical"
		slideshow: true,                //Boolean: Animate slider automatically
		directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
		controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
		keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys
		mousewheel: false               //Boolean: Allow slider navigating via mousewheel
	});
	
	//PRETTY PHOTO
	$("a[data-rel^='prettyPhoto']").prettyPhoto();
	
	//CAROUSEL FOR LATEST NEWS
	$('#carousel').elastislide({
		imageW 		: 380,
		margin		: 20,
		border		: 4,
		minItems	: 1,
		easing		: 'easeInBack'
	});
	
	//JQUERY TIPSY TO CREATE A TOOLTIP
	$('.sharing a').tipsy({gravity: 's'}); // nw | n | ne | w | e | sw | s | se
	
	//FILTERABLE PORTFOLIO
	$('#portfolio-list').filterable();
	
	$('html.ie #header').css({'position':'absolute','z-index':999});
	$('html.ie .section2').css({'position':'relative','padding-top':126,'background-position':'left 126px'});
	$('html.ie .flex-control-nav').css({'bottom': 25});
	$('html.ie .es-carousel ul li img').css({ 'background':'none', 'border':'none', 'box-shadow':'none', '-moz-box-shadow':'none', '-webkit-box-shadow':'none' });
	$('html.ie .detail').css({ 'background-position':'center -124px'});
	$('html.ie .comment_img').css({ 'width':80, 'float':'left' });
	$('html.ie .sidebar_listing li a').css({'box-shadow':'none', '-moz-box-shadow':'none', '-webkit-box-shadow':'none' });
	$('html.ie select').css({'max-width':'90%'});
	$('.chzn-container-single .chzn-search input').css({'display':'none'});
// Javascript code 
})

//JUMP MENU
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
