function Set_RCookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = 1 * 1000 * 60 * 3 ;
	}
	//expires = 1 * 1000 * 60 * 3 ;
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only
   //expires2 = today.getTime();
   //expires = expires+expires2;
   
	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function Get_RCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) 
	{
		return null;
	}
}

function getInternetExplorerVersion_a() {
 var rv = -1;
 if (navigator.appName == 'Microsoft Internet Explorer') {
		var ua = navigator.userAgent;
		var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null)
		rv = parseFloat(RegExp.$1);
  }
  if ( rv == '6' ){
	 return true; 
   }
   return false;
}

function close_ramadan_fr(){
	Set_RCookie( 'RCatFish', '', '', '/', 'maktoobblog.com', '' );
	Set_RCookie( 'RCatFish', '', '', '/', 'maktoob.com', '' );
	document.getElementById('fixmetoo_rMDFwed').style.display='none';
	
}
// 486
var marginLeft = screen.width / 2;
marginLeft = marginLeft - (486 + 10 );
marginLeft = 'left:'+ marginLeft + 'px;';

if ( Get_RCookie('RCatFish') != '' && getInternetExplorerVersion_a() && ( localizationCountry !== 'sa' && localizationCountry !== 'ae' ) )
 document.write('<link href="http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/images/catfish-new.css" rel="stylesheet" type="text/css" /><div id="fixmetoo_rMDFwed" style="height:80px;width:972px;'+marginLeft+'background:transparent;"><iframe id="IE_RAMDAN_IfrM" height="80px" dir="rtl" src="http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/iframe.html" marginwidth="0" marginheight="0" class="ramadan_bar"  vspace="0" hspace="0" style="z-index:99999999;width:100%; margin:0 auto;height:83px;background:transparent;" frameborder="0" scrolling="no" ></iframe><div onclick="javascript:close_ramadan_fr();return false;" style="background:transparent url(http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/images/blank.gif);position:absolute;top:15px;left:3px;width:8px;height:2px;cursor:pointer;z-index:99999" >&nbsp;</div></div><!--[if IE 8]> <style type="text/css">.ramadan_bar .rclose{float:none;}</style> <![endif]--> <!--[if IE 7]> <style type="text/css"> .ramadan_bar .rclose{float:left;} </style><![endif]--> <!--[if gte IE 5.5]> <![if lt IE 7]> <style type="text/css">div#fixme_RMGGGa {top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + "px" );}div#fixmetoo_rMDFwed {top: expression( ( 0 - fixmetoo_rMDFwed.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) )  + "px" );}</style> <![endif]> <![endif]-->');
else if ( Get_RCookie('RCatFish') != '' && ( localizationCountry !== 'sa' && localizationCountry !== 'ae' ) ){
	document.write('<link rel="stylesheet" type="text/css" href="http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/images/ramadan_bar.css?ll'+localizationCountry+'" /> <link href="http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/images/catfish-new.css" rel="stylesheet" type="text/css" /> <div class="barbox" id="fixmetoo_rMDFwed" style="width:972px; _width:auto; margin:0 auto;position: static;_position:inherit;" > <div style="position:fixed;bottom:0px;width:972px;z-index:99999999" class="ramadan_bar"> <img src="http://i1.makcdn.com/images/ramadan/RamadanAcrossMaktoob/catFish/images/blank.gif" alt="" width="970" height="89" border="0" usemap="#ramadan" /> <map name="ramadan" id="ramadan"> <area target="_blank" shape="rect" coords="630,1,957,83" href="http://islam.maktoob.com/ramadan/gameStep1?_s_icmp=l05Iksg9" alt="" /><area shape="rect" coords="3,19,14,30" href="#" onclick="close_ramadan_fr();return false;" alt="" /><area shape="rect" target="_blank" coords="38,2,349,83" href="http://islam.maktoob.com/ramadan/sms?_s_icmp=78gsh7Oc" alt="" /> </map>  </div> </div>  <!--[if IE 8]> <style type="text/css">.ramadan_bar .rclose{float:none;}</style> <![endif]--> <!--[if IE 7]> <style type="text/css"> .ramadan_bar .rclose{float:left;} </style><![endif]--> <!--[if gte IE 5.5]> <![if lt IE 7]> <style type="text/css">div#fixme_RMGGGa {top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + "px" );}div#fixmetoo_rMDFwed {top: expression( ( 0 - fixmetoo_rMDFwed.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) )  + "px" );}</style> <![endif]> <![endif]-->');
}
