$(document).ready(function(){
						   
	//Resize Starts -----------------/					   
	var RestoreTime;
	var fixWidth = 1263;
	$('#iframewin').width(fixWidth);
	function setWidth()
	{
		var docWidth = $(window).width();				
		if(docWidth > fixWidth)
			$('#iframewin').animate({"width": fixWidth}, 650);
		else
			$('#iframewin').animate({"width": docWidth}, 650);
	}
	
	$(window).resize(function() {
		clearTimeout(RestoreTime);
		RestoreTime = setTimeout(setWidth, 50);
	});

$(menus);

//Menu Starts -----------------/
	/**/var $DropdownMenu = $("#nav");
var $DivSubNav= $DropdownMenu.find(".drop");
var $MenuHover= $DivSubNav.find("a");
$('#overlayBg').animate({opacity:'0.0'});
$('#overlayBg').css('z-index', '1');
$DivSubNav.each(function () {
    $(this).parent().eq(0).hoverIntent({
        timeout: 200,over: function () {
            var current = $(".drop:eq(0)", this);current.slideDown(200);
			$('#overlayBg').animate({opacity:'0.7'});
			$('#overlayBg').css('z-index', '5');
			current.parent().find('a').addClass('act');
        	},out: function () {
            var current = $(".drop:eq(0)", this);current.slideUp(200);
			$('#overlayBg').animate({opacity:'0.0'});
			$('#overlayBg').css('z-index', '1');
			current.parent().find('a').removeClass('act');
        	}
    	});
	});


var $DropdownMenu2 = $(".menuHold");
var $DivSubNav2= $DropdownMenu2.find(".drop");
var $MenuHover2= $DivSubNav2.find("a");
$DivSubNav2.each(function () {
    $(this).parent().eq(0).hoverIntent({
        timeout: 200,over: function () {
            var current = $(".drop:eq(0)", this);current.slideDown(200);
			current.parent().find('a').css({color:'#666'});
        	},out: function () {
            var current = $(".drop:eq(0)", this);current.slideUp(200);
			current.parent().find('a').css({color:'#fff'});
        	}
    	});
	});
});
 

		
		
		
		function portfolioTabs() {
		var indicator = $('#indicator'), indicatorHalfWidth = indicator.width()/2, lis = $('ul#aboutNav li').children('a');
		var api = $("ul#aboutNav").tabs(".Col_rtCnt > .new", { api: true,
			onBeforeClick: function(event, index) {
					var li = lis.eq(index), 
					    newPos = li.position().top + (li.height()/2) - indicatorHalfWidth;
						
					indicator.stop(true).animate({ top: (newPos+6) }, 600, 'easeInOutExpo');
					
					//window.location.replace('/aboutus.html/#'+index);
					
					
				},
				onClick: function(event, index)
				{
					//window.location.href ="aboutus.html#"+index;
				}
			});
			
		}
		
		function testoSort(){
					var indicator = $('#indicator'), indicatorHalfWidth = indicator.width()/2, lis = $('ul#vNav').children('li');
					$(".testo").scrollable({ vertical: true, circular:true, mousewheel: true, size:12,
									onSeek: function(event, index) {
									var li = lis.eq(index),
										newPos = li.position().top + (li.height()/2) - indicatorHalfWidth;
									indicator.stop(true).animate({ top: newPos }, 250, 'easeInOutExpo');
										}
									}).navigator({
					navi:'ul#vNav'
				});
				
				$('.testo').scrollableAddClones();
		}
		function careerSort(){
					var indicator = $('#indicator'), indicatorHalfWidth = indicator.width()/2, lis = $('ul#vNav').children('li');
					$(".testo").scrollable({ vertical: true, circular:true, mousewheel: true, size:4,
									onSeek: function(event, index) {
									var li = lis.eq(index),
										newPos = li.position().top + (li.height()/2) - indicatorHalfWidth;
									indicator.stop(true).animate({ top: newPos }, 250, 'easeInOutExpo');
										}
									}).navigator({
					navi:'ul#vNav'
				});
				
		}
	
	
			$.fn.scrollableAddClones = function() {
			  // grab scrollable plugin
			  var scrollable;
			  if (!(scrollable = $(this).data('scrollable')) || !scrollable.getConf().circular)
				return;
			  // grab scrollable elements and remember it's count
			  var nodes = scrollable.getItems();
			  var length = nodes.length;
			  // grab class for the nodes
			  var clonedClass = scrollable.getConf().clonedClass;
			  // get wrap object to append the clones to
			  var wrap = scrollable.getItemWrap();
			  // add 8 clone objects - start at 1 as element[0] was already cloned by scrollable()
			  for (var i = 1; i <= 12; i++) {
				nodes.eq(i % length).clone().addClass(clonedClass).appendTo(wrap);
			  }
			}

$(function() {

	$("a[rel]").overlay({
		mask: '#000'
	});
	$('#overlay').next().find('img').hide();
});
 
function portfolio_gal(){
	
    $('.photoCntFrame').scrollable({ circular: true, mousewheel: false, size:1}).autoscroll().navigator(".thumbCnt");
	 $('.thumbScrl').scrollable({ circular: false, mousewheel: true, size:1, next:'.arrow_rt', prev:'.arrow_lt'}).autoscroll();
	 	var scrollable = $(".thumbScrl").data("scrollable");
			  	var size = 5;
			  	scrollable.onSeek(function(event, index) {
					if (this.getIndex() >= this.getSize() - size) 
					{
					  
					}
			  	});
			  	scrollable.onBeforeSeek(function(event, index) {
					if (this.getIndex() >= this.getSize() - size) 
					{
					  if (index > this.getIndex()) {
					  	//$(".arrow_lt").removeClass("disabled");
						return false;
					  }
					}
			  	});
				
		$('.thumbs').hover(
			function(){$(this).find('.thumbMask').animate({top:"148px"}, 100);}, 
			function(){$(this).find('.thumbMask').animate({top:"0px"});}
		);
	
}		
