function popUpWindow(href,height,width) {
	if(width) w = width;
	else w = 500;

	if(height) h = height;
	else h = 500;

	window.open(href,"","width="+w+",height="+h+",scrollbars=1");
	return false;
} 

$(document).ready(function() {

	//popup link open
	
	 $('a.popUp').click(function(){
	
		 $href =$(this).attr('href');
		 $height = $(this).attr('height');
		 $width = $(this).attr('width');
		
		 popUpWindow($href,$height,$width);
		 return false;
	 }); 
	
	// Drop-down Menu

	if($("ul.dropdown ul").length) {
	
		$("ul.dropdown ul").css("display", "none")
	
		$("ul.dropdown li").hover(function(){
			$(this).addClass("hover");
			$('> .dir',this).addClass("open");
			$('ul:first',this).show();
		},function(){
			$(this).removeClass("hover");
			$('.open',this).removeClass("open");
			$('ul',this).hide();
		});
	
	}


		$("a.submit").click(function(){
			rel = $(this).attr("rel");
			if(rel) {
				$("#"+rel).submit();
			}
			return false;
		});

   
   $('img[@src$=.png], div, dl, a').ifixpng();

	// remove left border on first LI of navigator
	$("#navigator li:first").addClass("first");

	if ( $('img[@alt="help"], input[@alt="help"], u[@alt="help"], a[@alt="help"] ').length ) {
		$('img[@alt="help"], input[@alt="help"], u[@alt="help"], a[@alt="help"]').tooltip({
			 track: true,
			 delay: 0,
			 showURL: false,
			 showBody: " - ",
			 opacity: 0.85,
			 top: 22,
			 left: 22
		 });
	 }
	



});

var detect = navigator.userAgent.toLowerCase();
var os_ = navigator.platform.toLowerCase();
var browser,thestring;

if (checkIt('safari')) browser = "Safari"
else browser = "not Safari"

if ( os_ == 'macppc' || os_ == 'macintel' ) os = "Mac"
else os = "not Mac"

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
