function SetCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function GetCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	} 
	
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	
	return unescape( document.cookie.substring( len, end ) );
}

function DeleteCookie( name ) {
	if ( GetCookie( name ) ) document.cookie = name + "=expired" +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
	
	
function popBreak(){

 	var today = new Date();
	today.setTime( today.getTime() );
	
 	var endDate = new Date();
	endDate.setFullYear(2007,0,2)

	if(today < endDate && GetCookie('synbreak') != 'popped') {
		
		SetCookie('synbreak','popped',1)

		var LPos = (screen.width) ? (screen.width-580)/2 : 0;
		var TPos = (screen.height) ? (screen.height-580)/2 : 0;
		var win = window.open('https://www.chooseyourvoucher.com.au/synbreak.html','synbreak',"top="+TPos+",left="+LPos+",height=570,width=570,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no");
		win.focus()
		
	}
	//DeleteCookie( 'synbreak' )
}

//Run popup
popBreak()
