/*
 * 	Pop Screen / Splash Screen Keren v 1.0 - jQuery plugin
 *	written by David Wijaya - Trilogicsoft Indonesia
 *
 *	Copyright (c) 2011 David Wijaya (http://www.trilogicsoft.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *
 */
 
(function ($) {$.fn.splashscreen = (function (options) {var defaults = {imgsplash : '',posBy : null,isbackground : true,width : 400,height : 500}; var options = $.extend(defaults, options);var _self = this, _parent = _self.parent(),$loadpic = new Array(),createBg = function(){$('body').append('<div id="_t_bgspals" class="spalsback"></div>');$('#_t_bgspals').css({'width' :  $(document).width() + 'px', 'height' : $(document).height() + 'px', 'z-index' : '999998', 'position' : 'absolute', 'top' : '0', 'left' : '0', 'background' : '#454545', 'opacity' : '0.5'}).fadeIn('5000');},getCookie = function (c_name) {if (document.cookie.length > 0) {c_start = document.cookie.indexOf(c_name + "=");if (c_start != -1) {c_start = c_start + c_name.length + 1;c_end = document.cookie.indexOf(";",c_start);if (c_end == -1) c_end = document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return "";},setCookie = function (c_name, value, cookieopt) {if(cookieopt.expires) {expires = '; expires=' + cookieopt.expires;}var path = cookieopt.path ? '; path=' + cookieopt.path : '';document.cookie = [c_name, '=', encodeURIComponent(value), expires, path,].join('');},popScreenPaused = function(){expdate = new Date();expdate.setTime(expdate.getTime() + (1 * 60 * 60 * 1000));expdate = expdate.toUTCString();setCookie('Fo9XF2YZcBaVFoy1F2aL', 'true', {expires: expdate, path: '/'});},createPopScreen = function($obj) {var popWidth = 0, popHeight = 0, posX = 0, posY = 0;popWidth = options.width;popHeight = options.height;$(window).scrollTop(0);var spalscontent = '';spalscontent += '	<div id="_spals" class="spals" style="position:fixed;">';spalscontent += '		<a class="spals_close">Tekan klik di sembarang tempat untuk menutup &quot;splash screen&quot;...</a>';spalscontent += '		<div id="_spals_m" class="spalsmid"><img src="'+ options.imgsplash +'" border="0" width="'+ popWidth +'" height="'+ popHeight +'" /></div>';spalscontent += '	</div>';$('body').append('<div id="_panel_spals" class="spals_panel"></div>');$('#_panel_spals').html(spalscontent);var $titleH = $('#_spals_t').outerHeight();$('#_panel_spals').css({'width':(popWidth + 2) +'px', 'height':(popHeight + 2)+'px', 'display':'none'});$('#_spals_m').css({'width':popWidth+'px', 'height':(popHeight - $titleH) + 'px'});$('#_panel_spals').fadeIn('slow');$('#_t_bgspals').click(function(){$('#_t_bgspals').each(function(){$(this).remove();});$('#_panel_spals').each(function(){$(this).remove();});popScreenPaused();});if(options.posBy == null) {posX = (($(window).width() - (popWidth + 30)) / 2) ;posY = Math.round(($(window).height() - (popHeight + 30)) / 2);} else {posX = options.posBy.offset().left + ((options.posBy.width() - (popWidth + 30)) / 2);posY = options.posBy.offset().top + ((options.posBy.height() - (popHeight + 30)) / 2);}$('#_panel_spals').css({'top':posY+'px', 'left': posX+'px'});};if(getCookie('Fo9XF2YZcBaVFoy1F2aL') != "true") {if(options.isbackground) createBg();createPopScreen($(this));} else {popScreenPaused();}});})(jQuery); 
