/****************************************
GLOBAL.JS
- This file is used to store functions that are called on everypage
****************************************/


/****************************************
$().ready()
- this function is triggered when all page elements have been loaded
and are ready to be manipulated. just like onload="init()"
****************************************/
$().ready(function(){
				   
	$("#txtEmail").focus(function() {
	   if (this.value == "Email Address"){
		 this.value = "";		 
	   }
	 });
	$("#txtEmail").blur(function() {
	   if (this.value == ""){
		 this.value = "Email Address";
	   }
	 }); 
	
	
	var $top = 0;
	if ($.browser.msie){
		$top = -130;
	}
	else{
		$top = -330;
	}
	
	$('a.library').cluetip({local:true,
						    hoverIntent: false,
							dropShadow: false, 
							showTitle: false,
							 positionBy:       'fixed',
     						sticky: true,
							topOffset:       $top, 
							leftOffset:       -35,
							waitImage:        false,
							closeText:        '',
							activation:       'click',
      						mouseOutClose: false, cursor: 'pointer'});
	
	$('a.library-right').cluetip({local:true,
						    hoverIntent: false,
							dropShadow: false, 
							showTitle: false,
							 positionBy:       'fixed',
     						sticky: true,
							topOffset:        $top, 
							leftOffset:       -435,
							waitImage:        false,
							closeText:        '',
							activation:       'click',
      						mouseOutClose: false, cursor: 'pointer'});
	
	$(".see-details").click(function() {							 
	   $(this).parent().find('a:first').click();
	}); 
	
	$(".closePopup").click(function() {
		$("#cluetip-close").click();
	}); 
	
	$("#lnkDemo").click(function(){
		popup(this.href,720,550);	
		$(this).attr({target: "NewWindow"});		
		return false;
	});
	
	
	//Rollovers
	$('img.rollover').hover(function() { 
		//over 
		var newImage = $(this).attr('src').replace('-off', '-on');
		$(this).attr('src', newImage); 
	},function() { 
		//out 
		var newImage = $(this).attr('src').replace('-on', '-off'); 
		$(this).attr('src', newImage); 
	});
	


});

// Open popup window
function popup(param_href, param_width, param_height) {
	popupw = window.open(param_href,"NewWindow","toolbar=0,directories=0,status=0,menubar=0,location=0,scrollbars=0,resizable=1,width="+param_width+",height="+param_height);
	popupw.focus();
}

