/*
 * iDeafNews
 * author1: Michael Greenland from CreativeBurn Studio, url: http://www.creativeburn.com
 * author1:
 * author1:
 * 
 * Date:	04/4/2011
 * Updated:	04/05/2011
 */
 
//$(document).ready(function(){
	//jQuery.noConflict();
	//$(".PaidSubscriberLogin").colorbox({opacity:.7, width:"50%", inline:true, href:"#PaidSubscriberLoginBox"});
	//$(".UpdateAlert").colorbox({opacity:.7, width:"50%", inline:true, href:"#UpdateAlertBox"});
	//$(".CaptionAlert").colorbox({opacity:.7, width:"50%", inline:true, href:"#CaptionAlertBox"});
	/*$(".TestAlert").colorbox({opacity:.7, inline:true, href:"#AutomaticWelcomeAdBox"});*/
	//$(".SAA").colorbox({opacity:.7, iframe:true, innerWidth:640, innerHeight:390});
	
	//function displayBacktoIDN(showhide) {
		//alert("showhide: "+showhide);
		//if(showhide != 'show') { $("#backtoblog").css("display", "none"); }	
	//}
	
	$.fn.blink = function(options)
	{
		var defaults = { delay:500 };
		var options = $.extend(defaults, options);
		
		return this.each(function()
		{
			var obj = $(this);
			setInterval(function()
			{
				if($(obj).css("visibility") == "visible")
				{
					$(obj).css('visibility','hidden');
				}
				else
				{
					$(obj).css('visibility','visible');
				}
			}, options.delay);
		});
	}

	//$('.blink').blink();
	
	function openWelcomeAd(){
		$.colorbox({opacity:.7, inline:true, href:"#AutomaticWelcomeAdBox", open:true});
	}

	function get_cookie(Name) {
	  var search = Name + "="
	  var returnvalue = "";
	  if (document.cookie.length > 0) {
	    offset = document.cookie.indexOf(search)
	    if (offset != -1) { // if cookie exists
	      offset += search.length
	      // set index of beginning of value
	      end = document.cookie.indexOf(";", offset);
	      // set index of end of cookie value
	      if (end == -1)
	         end = document.cookie.length;
	      returnvalue=unescape(document.cookie.substring(offset, end))
	      }
	   }
	  return returnvalue;
	}

	function loadWelcomeAd(){
		if (get_cookie('launched')==''){
			openWelcomeAd();
			document.cookie="launched=yes";
		}
	}
	
	//loadWelcomeAd();
//});

