

   var curtainad_file="http://asimg.sinahk.net/2009/inhouse/default_homepage_0910_banner_770x65_final.swf";
   var curtainad_width="770";
   var curtainad_height="65";
   var curtainad_url="http://www.sina.com.hk";
   var curtainad_creative='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,2,0" width="'+curtainad_width+'" height="'+curtainad_height+'"><param name=movie value="'+curtainad_file+'?clickTAG='+curtainad_url+'"><param name=quality value=high><PARAM NAME=wmode VALUE=transparent><PARAM NAME="allowScriptAccess" VALUE="always"><embed src="'+curtainad_file+'?clickTAG='+curtainad_url+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+curtainad_width+'" height="'+curtainad_height+'" allowScriptAccess="always"></embed></object><div style="padding-bottom:5px;"></div>';

   var creative_tag = document.getElementById("curtainAds");
 
   if (creative_tag){ 
      creative_tag.innerHTML = curtainad_creative;
   } else {
      document.write(curtainad_creative);
   }


function Get_Cookie_defaulthp( check_name ) {
	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 Set_Cookie_defaulthp( 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() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}




var str = document.location.href;
var reg1 = new RegExp("mysinablog.com");



var count_defaulthp = Get_Cookie_defaulthp('curtain_ad_defaulthp');
if(count_defaulthp == null) {
   Set_Cookie_defaulthp('curtain_ad_defaulthp','1', 90, '/', 'mysinablog.com', '');
   count=1;
}

   if(navigator.userAgent.indexOf("MSIE")!=-1)
   {  
         if((count_defaulthp == null) || (count_defaulthp==1)) 
         {      	
	     document.getElementById('curtainAds').style.display = "block";
             if (reg1.test(str))   {  document.write('<SC'+'RIPT LANGUAGE="JavaScript" SRC="http://as.sinahk.net/j?s=26&c=27348&w=1&h=1&t=_blank"></SC'+'RIPT>'); }
         }
         else
         {
             document.getElementById('curtainAds').style.display = "none";
         }
   }
   else
   {
	 document.getElementById('curtainAds').style.display = "none";
   }   


var addHomePage="http://www.sina.com.hk/";

function close_ad_defaulthp()
{
   document.getElementById('curtainAds').style.display = "none";
   Set_Cookie_defaulthp('curtain_ad_defaulthp','3', 90, '/', 'mysinablog.com', '');
}

function setHP()
{

   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(addHomePage);
   
   var e = document.createElement("script");
   if (reg1.test(str))   {  e.src = "http://as.sinahk.net/j?s=26&c=27349&w=1&h=1&t=_blank"; }
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}