// qtip style
//
$.fn.qtip.styles.pmg = { // Last part is the name of the style
	background: '#E8F5FA', 
	color: 'black',
	border: {
		width: 2,
		radius: 5,
		color: '#3FABD5'
	},
	tip: 'bottomLeft',
	padding: '7px 13px',
	width: {
		max: 410,
		min: 410
	},
	name: 'blue',
	'font-family': 'Symbol'
}

// cookie handling
//
function checkSiteCookie() {
	// get the cookie
	//
	var readDisclaimer = $.cookie('pmgdisclaimer');
	var countrySelected = $.cookie('pmgcountry');
	
	// check the cookie
	//
	if ((readDisclaimer != 1)  || (countrySelected == null)) {
		// redirect the client
		//
		window.location = '/';
	}
}

function setPMGCookies(country) {
	// check the checkboxes
	//
	if ($('#ck_disclaimer').getValue() == '') {
		$("#read_disclaimer").dialog({
			bgiframe: true,
			modal: true
		});
		$("#read_disclaimer").dialog('open');
		return;
	}
	
	// set the cookies
	//
	$.cookie('pmgdisclaimer', '1', { expires: 30 });
	if ($('#ck_qualianleger').getValue() == '1') {
		$.cookie('pmgqualianleger', '1', { expires: 30 });
	} else {
		$.cookie('pmgqualianleger', '', { expires: -1 });
	}
	$.cookie('pmgcountry', country, { expires: 30 });
	
	// redirect the client
	//
	window.location = '/home/';
}

function openCCSF() {
	if( typeof( window.screenX ) == 'number' ) {
		intLeft = window.screenX;
		intTop = window.screenY;
	}
	else {
		intLeft = window.screenLeft;
		intTop = window.screenTop;
	}  
	winStart = window.open('http://www.sags.ch/cancer-charity-support-fund/start.asp?r=0&c=0','_winStart','left='+ (intLeft + 250) +',top='+  intTop +',width=1015,height=625'); 
}