/*
 * Created by Richard Lee, eMarketing
 * !REQUIRES jQuery
 */

function oscFullWin(event){
	// Define defaults for older browsers that have issues
	var winWidth = 1024; 
	var winHeight = 768;
	var winLeft = 0;
	var winTop = 0;
    
	if (screen.availWidth) {
	   // Set max width
	   winWidth = (screen.availWidth < winWidth) ? screen.availWidth : winWidth;
	   winHeight = (screen.availHeight < winHeight) ? screen.availHeight : winHeight;
	}
	// Check window open available - if not default link event will proceed
	if (window.open) {
		var winLeft = (screen.availWidth/2)-(winWidth/2);
		var win = window.open(this.href,'popup','toolbar=no,location=yes,scrollbars=yes,resizable=yes,width='+winWidth+',height='+winHeight+',left='+winLeft+',top='+winTop);
		win.focus();
		return false; // Stop default link event
	} 

}

// On page ready...
$(document).ready(function(){
	$('.dropdown ul').hide();
	$('.dropdown').hover(function(){$('.dropdown ul').slideDown('fast').show();},function(){$('.dropdown ul').slideUp('fast').hide();});
	$(".dropdown a").click(oscFullWin);
	// For content links to service centre (Eg <a class="osc" href="<product osc>">Online service centre</a>)
	$(".osc").click(oscFullWin);
});
