// JavaScript Document

	

	function fixLinks($){
		
		 		$('#main-nav>ul').css({
					background: '#467cbf',
					padding: '10px 0 5px 0px',					
					position: 'relative',
					width: '300px',
					'z-index': '1000',
					'float': 'left'
				});
				 
				
				$('#main-nav>ul>li').css({									  
					'margin': '5px 0 5px 35px',
					'padding-right': '10px'
					 
				});
				
				
				
				$('#main-nav>ul>li>a').css({									  
					'background' : 'url('+path+'images/mainNav_button.jpg) no-repeat 0 0',
					'color': '#355184',
					'display': 'block',
					'font-weight': 'bold',
					'height': '29px',
					'line-height': '28px',
					'padding-left': '15px',
					'text-transform': 'uppercase',
					'margin-bottom': '7px',
					'width': '197px' 			  
				});
				
				$('#main-nav>ul>li>a').css({color: '#467cbf'});
				$('.hlder').hide();	
		 
				//TO ARRANGE NAVBAR 
				var totalHeight = 0; //THE LIMIT HIGHT, ONCE IT PASSES THIS HEIGHT ELEMENTS SHOULD GO INTO THE NEXT COLUMN
				var secondNavbar = '';
				var primaryNavbar = '';
				function arrangeNav(){
					$('#cElmnt').remove();
					 
					$cUlElmnt = $('<div id="cElmnt"><ul >'+$(lastElmnt).html()+'</ul></div>').css({position:'absolute', top: '-5000000px'});					
					 
					
					
					$('#container').append($cUlElmnt);
				
						
						secondNavbar = '';	
						primaryNavbar = '';	
						totalHeight = 0;
						 
						$.each($('#cElmnt>ul>li'), function (i, val){ 
							
							
							
							if(totalHeight > 200){							 
								secondNavbar += '<li>'+$(this).html()+'</li>';
								 
							}else{
								primaryNavbar += '<li>'+$(this).html()+'</li>';
								totalHeight += parseInt($(this).height());	
							}
							 
								 
							 
						}) 
			 		 
					  
						  
						$('#overMenu').html('<ul>'+$(lastElmnt).html()+'</ul>');
						$('#overMenu').html($('<ul>'+primaryNavbar+'</ul>'+'<ul style="margin-right:-100px" >'+secondNavbar+'</ul>'));
						$('#overMenu>ul>li>a').prepend($('<img src="'+path+'images/mainNav_Bullets.png" />'));
						$('#overMenu').fadeIn("fast");
						 
						 
						 
						
					
					
				}
			 
				lastElmnt = false; 
				var isOver = 1;
				$(document).ready(function(){
							 
							
							
							
						
							// SUBLINKS EVENT
							$('#main-nav>ul>li').mouseover(function(e){
								var target =  $.browser.msie ?  window.event.srcElement :   e.target; 
													
								isRoot = $(target).parent('li').attr('id');
								isAElmnt = target.nodeName.toLowerCase() === 'a'; 
								
								if(isRoot && isAElmnt === true){
																				
										lastElmnt = $(this).children('ul');
										if($(this).children('a').html() == 'Partnership'){
										return true;	
										}
										
										if( $('#overMenuBG').is(":hidden") == true){ 	
											 
											 $('#overMenuBG').css({opacity : 0.1, display : 'block'}).fadeTo('fast', 0.9, arrangeNav);													 											

										}else{
											$('#overMenuBG').css({opacity : 0.9, display : 'block'})
											arrangeNav();
												
										}
										
									
										
									}
											 
								
							})
							
							$('body').mousemove(function(e){
								var target =  $.browser.msie ?  window.event.srcElement :   e.target; 
								parentElmnt = $(target).parent('div').attr('id'); 					
							  	cHeight = $('#page-heading').height();
								parentOffest = $('#container').offset();
										 
								
								 if(e.pageX < parentOffest.left + 20 || e.pageY < (cHeight+20) || e.pageX > (800+parentOffest.left) || e.pageY >  cHeight + 283){
									
											$('#overMenu:visible').css({'display':'none'}); 
																				   
										 	$('#overMenuBG').css({opacity : 0, display : 'none'});
									 
										 
									 
									
								 }
								 
								
								 
							}) 
							
							
							 
				
				
				})
				
			
			 
		 		   
	}
	
	
	
	var flashObj;
	
	
	
	function showVideo (e){
		var 	paneTop,
				paneLeft,
				paneWidth,
				paneHeight;
		
		var tg = (window.event) ? e.srcElement : e.target;
		videoSRC = aPath + '/videos/testimonials/'+ jQuery(tg).attr('rel');
		videoSKIN = aPath + '/flash/SteelOverPlaySeekMute.swf';
	 
		var flashvars = false;
		var params = {
		  wmode : "transparent",
		  menu  : "false", 
		  flashvars: "VideoFile="+videoSRC+"&videoSkin="+videoSKIN  
		  
		}; 
		 
		  
		swfobject.embedSWF(path+"flash/SWFVideoPlayer.swf", "video-holder", "720", "420", "9.0.0", "", flashvars, params);
		
		paneWidth = jQuery("#previewPane").width();
		paneHeight = jQuery("#previewPane").height() + 100;
		paneTop = (jQuery(window).height() / 2) - (paneHeight / 2) + jQuery(window).scrollTop() + "px";
		paneLeft = (jQuery(document).width() / 2) - (paneWidth / 2) + "px";
	
		jQuery("#previewPane")
			.css({
				top: paneTop,
				left: paneLeft
			})
			.fadeIn("fast");
		
		return false;
	}
	

	function hidePreview(){
		jQuery("#previewPane").fadeOut("fast", function (){
			jQuery("#video-holder").html("");													
		});
		return false;
	}