$(document).ready(function(){
 $("#downloads1").hover(
  function (){ $(this).attr("src","/design/tpl/img/downloads_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/downloads.png"); }
 );
 $("#news1").hover(
  function (){ $(this).attr("src","/design/tpl/img/news_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/news.png"); }
 );
 $("#portfolio1").hover(
  function (){ $(this).attr("src","/design/tpl/img/portfolio_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/portfolio.png"); }
 );
 $("#contact1").hover(
  function (){ $(this).attr("src","/design/tpl/img/contact_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/contact.png"); }
 );
 $("#home1").hover(
  function (){ $(this).attr("src","/design/tpl/img/home_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/home.png"); }
 );
 $("#login1").hover(
  function (){ $(this).attr("src","/design/tpl/img/login_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/login.png"); }
 );
  $("#rd1").hover(
  function (){ $(this).attr("src","/design/tpl/img/rd_active.png"); },
  function (){ $(this).attr("src","/design/tpl/img/rd.png"); }
 );
});

function ShowForm(){
	if(typeof document.body.style.maxHeight === "undefined"){//if IE 6
		$("body","html").css({height: "100%", width: "100%"});
		$("html").css("overflow","hidden");
		if (document.getElementById("TB_HideSelectHS") === null) {//iframe to hide select elements in ie6
			$("body").append("<iframe id=\"TB_HideSelectHS\"><\/iframe><div id=\"TB_overlayHS\"><\/div>");
			$("#TB_overlayHS").click(function(){
				$("#TB_window").fadeOut("fast",
				function(){$("#TB_overlayHS, #TB_HideSelectHS").trigger("unload").unbind().remove();});
				$("body","html").css({height: "auto", width: "auto"});
				$("html").css("overflow","");
			});
		}
	}else{//all others
		if(document.getElementById("TB_overlayHS") === null){
			$("body").append("<div id=\"TB_overlayHS\"><\/div>");
			$("#TB_overlayHS").click(function(){ 
				$("#TB_window").fadeOut("fast",
				function(){$("#TB_overlayHS").trigger("unload").unbind().remove(
				);});});
		}
	}
	$("#TB_overlayHS").addClass("TB_overlayBG");
	Show_form();
}

function Show_form(){
	var pagesize=tb_getPageSize();
	var ras=new Array();
	ras[0]=(pagesize[0]/2)-(120);
	ras[1]=(pagesize[1]/2)-(200);
	$("#TB_window").css("left",ras[0]);
	$("#TB_window").css("top",ras[1]);
	$("#TB_window").fadeIn("fast");
}

function CloseForm(){
	$("#TB_window").fadeOut("fast",function(){$("#TB_overlayHS").trigger("unload").unbind().remove();});
}


function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}
