// JavaScript Document

$(function(){

	// Accordion
	$("#accordion").accordion({ header: "h3", active: false, collapsible: true, autoHeight: false  });
	
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
});
			
			
$(document).ready(function() {
	
	  //$('#subListInsure').hide();
	 
	//  $('#selectInsure').click(function() {
//		$('#subListInsure').slideToggle(400);
//		return false;
//	  });
	  
	  //$("#selectInsure").hover(handlerIn, niller);
	  
	  $("#selectInsure").hover( mouseenterInsureSelect,  niller );
	  
	  function niller(){} // in case we don't use jquery 1.4

	function mouseenterInsureSelect() {
		$('#subListInsure').slideDown(400);
		//if($.browser.msie && jQuery.browser.version.substr(0,1)=="7"){
//			alert('ie7');
//			$('.navSegment li.hdr').css("font-weight", "bold");
//		}
		
		
		//if(!jQuery.support.boxModel){
//			$('.navSegment li.hdr').css("font-weight", "bold");
//		}
	}
	
	function executeTopNavReset(){
		$('#subListInsure').fadeOut(200);
	}
	$("#mainContBox").bind('mouseenter', executeTopNavReset);
	$(".mainContBox").bind('mousenter', executeTopNavReset);
	$("#containerMain").bind('mouseenter', executeTopNavReset);
	$(".nav").bind('mouseenter', executeTopNavReset);
	//$("#test").bind('mouseenter', executeTopNavReset);

	
});


$(window).load(function() {
	
	$('#credits1').click(function(e) {
		  //alert('#credits1 handler for .click() called. e.pageX=' + e.pageX + ' and e.pageY=' + e.pageY);
		  $('#specto').css({left: e.pageX-216+'px', top: e.pageY - 100 +'px'}).fadeIn();
		  $(window).scroll();
	});
	
	$('#specto').click(function() {
		  //alert('Click handler for #specto called.');
		  $('#specto').hide();
	});
	 
});

function hide() {
	$('#specto').hide();
}



// JavaScript Document
///////////////////////////////////////
//  Copyright SpectoDesign 2004      //
//  www.spectodesign.com             //
//  Axel Muench, September 03, 2004  //
//  $version: 1.0.1 mod: 10-21-04    //
///////////////////////////////////////

var winDebug = false;


function NewWindowCopy(url, name, scroll, oldwindow) {
	var w = getWinWidth(oldwindow);
	var h = getWinHeight(oldwindow);
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'fullscreen=no,toolbar=yes,status=yes,menubar=yes,location=yes,directories=yes,height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	if (winDebug) {alert(winprops);}
	win = window.open(url, name, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}




function NewWindowCopy2(url, name, scroll) {
	var w, h;
	
	if (document.layers){
		w=window.outerWidth;
		h=window.outerHeight;
		//alert("1 - w="+w+" h="+h);
	} else if (document.all){
		w=document.body.clientWidth;
		h=document.body.clientHeight;
		//alert("2 - w="+w+" h="+h);
	} else if(document.getElementById){
		w=window.outerWidth;
		h=window.outerHeight;
		//alert("3 - w="+w+" h="+h);
	} else {
		w = 600;
		h = 480;
	}
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'fullscreen=no,toolbar=yes,status=yes,menubar=yes,location=yes,location=yes,height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	if (winDebug) {alert(winprops);}
	win = window.open(url, name, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	window.onLoad = NewWindowCopy2;
}

function NewCenterWindow(url, name, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	if (winDebug) {alert(winprops);}
	win = window.open(url, name, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth + 'Height = ' + myHeight );
 }
 
 
 function getWinHeight(window) {
  var myHeight = 400;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
 }
 
 function getWinWidth(window) {
  var myWidth = 400;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return  myWidth;
 }
 

function onTop() {
  if (win.blur) win.focus();
}

function blowOut() {
  if (win != null && win.open) win.close();
}
