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 setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) +
	( ( expires )? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
	( ( path )? ';path=' + path : '' ) +
	( ( domain )? ';domain=' + domain : '' ) +
	( ( secure )? ';secure' : '' );
}

function deleteCookie( name, path, domain ) {
	if ( getCookie( name ) ) document.cookie = name + '=' +
	( ( path )? ';path=' + path : '') +
	( ( domain )? ';domain=' + domain : '' ) +
	';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}

//can check bla.bla.bla[]..
isset = function(e) {
	try {
		if (eval(e)) {}
	}
	catch(err) {
		return false;
	}
	return true;
}

function pageWidth() {
    return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}
function pageHeight() {
    return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}
function microtime() {
	return new Date().getTime();
}

function switchMovie(o,flv,w,h) {
	o.parentNode.innerHTML = '<embed height="'+h+'" width="'+w+'" flashvars="config={playList: [ { url: \''+o.src+'\', overlayId: \'play\' },{ url: \''+flv+'\' } ], autoBuffering: false, useHwScaling: true, loop: false, autoRewind: true, usePlayOverlay: false, useSmoothing: true, autoPlay: true, useNativeFullScreen: true, showMenu: false, initialScale: \'scale\' }" allowfullscreen="true" allowscriptaccess="always" quality="high" bgcolor="#FFFFFF" name="SextronixPlayer" id="SextronixPlayer" src="images/movies/player.swf" type="application/x-shockwave-flash"/>';
}

function switchMovie_hd(o,flv,w,h) {
        o.parentNode.innerHTML = '<embed height="'+h+'" width="'+w+'" flashvars="config={playList: [ { url: \''+flv+'\' } ], splashImageFile: \''+o.src+'\', usePlayOverlay: false, autoPlay: true, initialScale: \'scale\', autoBuffering: false, bufferLength: 1, autoRewind: true, loop:false, showStopButton: true, showScrubber: false, showVolumeSlider: false, showMuteVolumeButton: true, showFullScreenButton: false, showMenu: false, controlsOverVideo: \'locked\', controlBarBackgroundColor: \'-1\' }" allowscriptaccess="always" quality="high" bgcolor="#FFFFFF" name="SextronixPlayer" id="SextronixPlayer" src="images/movies/Player.swf" type="application/x-shockwave-flash"/>'; 
}  


var GAL_URL = "http://www.sunnyfuck.com/"; 
window.onbeforeunload=confirmClose; 
function confirmClose() { 
	if (shut) { window.shut = false; 
				setCookie('shut','false',1); 
				window.location.href=GAL_URL; 
				return '------------------------------------------------------------------ \n\rWait! Click "CANCEL" to see more free porn.\n\r ------------------------------------------------------------------'; } } 
				var shut; 
				if (getCookie('shut') == 'false' || window.location.href.match('/nc/')) { shut = false; } 
				else shut=true; $().init(function(){ $("a").each(function(k,o){$(o).bind("click",function(e){shut=false})}); }); 