/* 
  ------------------------------------------------
  PVII Uberlink
  Current Page Link Highlighter
  Copyright (c) 2007 Project Seven Development
  www.projectseven.com
  Version: 1.0.0
  ------------------------------------------------
*/
function init() 
{
	P7_Uberlink('p7uberlink','p7bod');	
}


function P7_Uberlink(cl,d){
	var i,ob,tA,h=document.location.href;
	if(document.getElementById){
	ob=(d)?document.getElementById(d):document;
	if(ob){
	tA=ob.getElementsByTagName('A');
	for(i=0;i<tA.length;i++){
	if(tA[i].href==h){
	tA[i].className=cl;
}}}}}


function toggleSectors(a, id, openText, closeText)
{
	var toggle = false;
	
	if (id.length <= 0)
		return;
		
	var obj = document.getElementById('sector_content_'+id);
	
	if (!obj)
		return;
	
	if (obj.className == 'hidden')
		toggle = true;
		
	var parentElements = obj.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('DIV');
	if (parentElements.length > 0)
	{
		for (var i=0; i<parentElements.length; i++)
		{
			if (parentElements[i].className == 'show')
			{
				parentElements[i].className = 'hidden';
				a.innerHTML = openText;
			}
		}
	}
	
	/*
	var imageElements = obj.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('IMG');
	if (imageElements.length > 0)
	{
		for (var i=0; i<imageElements.length; i++)
		{
			if (imageElements[i].className == 'toggleImage')
			{
				imageElements[i].src = '/images/up.png';
			}
			
		}
	}
	*/

	if (toggle)
	{
		obj.className = 'show';
		
		//var image = document.getElementById('image_'+id);
		//if (image)
		//	image.src = '/images/down.png';
		
		a.innerHTML = closeText;
		
	}
	return;
}

function printDetails(id)
{
	NewWindow('print-flight-details.php?id='+id, 'newwindow', 768, 540, 1);	
}

function NewWindow(mypage,myname,w,h,scrol) 
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	win = window.open(mypage ,myname, "height="+h+",width="+w+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+scrol+",status=0");
	win.focus();
}

function clickIE4()
{
	if (event.button==2)
	{
		return false;
	}
}

function clickNS4(e)
{
	if (document.layers||document.getElementById&&!document.all)
	{
		if (e.which==2||e.which==3)
		{
			return false;
		}
	}
}

if (document.layers)
{
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown = clickNS4;
}
else if (document.all&&!document.getElementById)
{
	document.onmousedown = clickIE4;
}

document.oncontextmenu = new Function("return false");


$(document).ready(function(){

$(".wrap div").hover(function() {
	$(this).animate({"top": "-310px"}, 400, "swing");
},function() {
	$(this).animate({"top": "0px"}, 400, "swing");
});

});
