function createRequestObject() {
   var ro = null;
   if (typeof XMLHttpRequest != "undefined") {
      ro = new XMLHttpRequest();
   } else {
      try {
         ro = new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e) {
         try {
            ro = new ActiveXObject("Microsoft.XMLHTTP");
         }
         catch (e) {
         }
      }
   }
   return ro;
}

var http = createRequestObject();
var BASE_URL = 'http://www.kapanlagi.com';


function sndReqGlobal(posted_plc ,posted_val, fields_menu, fields_content,showroll) {
   try 
   {
      var temp;
      temp = document.getElementById(fields_content).innerHTML;
      
      http.open('post', posted_plc);
      http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      http.send(posted_val);
      
      if(showroll=='true'){
         document.getElementById(fields_content).innerHTML = '<img src="http://www.kapanlagi.com/i/v2/indicator_remembermilk_orange.gif"> <span style="color:red; font-size:10px;">Silahkan Tunggu, Sedang Mengambil Data ...</span>';
      }
      
      http.onreadystatechange = function ()
      {	
         if (http.readyState == 4)
         {
            if (http.status == 200)
            {
               var response = http.responseText;
               if (response.indexOf('||') != -1)
               {
                  update = new Array;
                  update = response.split('||');
                  switch (update[0])
                  {
                     case "alert" :
                        alert(update[1]);
                        document.getElementById(fields_content).innerHTML = temp;
                              
                     break;
                  }
               }
               else if (response.indexOf('<-|-SEPARATOR-|->') != -1)
               {
                  doubleData = response.split('<-|-SEPARATOR-|->');
                  document.getElementById(fields_menu).innerHTML = doubleData[0];
                  document.getElementById(fields_content).innerHTML = doubleData[1];
               }
               else 
               {
                  document.getElementById(fields_content).innerHTML = response;
               }
            } 
            else 
            {
               alert("ERROR:" + http.status + " Ada masalah pada pengiriman data!");
               document.getElementById(fields_content).innerHTML = temp;
            }
         }			
      }
   }
   catch(e) {}
   finally {}

   return false;
}
/****************************************
 ** FOR TOP NEW MENU -- ICON --
 ***************************************/

function getDataService2(go, action, id, id2, b) 
{
	processLoading(id);
	
	try
	{
		http.open('post', go);
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.send(action);

		http.onreadystatechange = function () {
			if(http.readyState == 4) 
			{
				var response = http.responseText;

				if (http.status == 200) 
				{
                                    var sp = response.split('||');
                                
                                    document.getElementById(id).innerHTML = sp[1];
                                    if (sp[0] == 'OK')
                                    {
                                        clearForm(id2);
                                        b.disabled = true;
                                    }
                                }
				else 
				{
					alert("ERROR:" + http.status + " Ada masalah pada pengiriman data!");
				}
			}
		}
	}
	catch (e){}
	finally {}
}

function clearForm(tab) {
      var d = document.getElementById(tab);
      if (d)
      {
          for (i = 0; i < d.length; i++)
          {
              if ((d[i].type == "text") || d[i].type == "textarea")
              {
                  d[i].value = '';
              }
              
              if (d[i].type == "checkbox")
              {
                  d[i].checked = false;
              }
          }
      }
}

 /*
    show message with red color
 */
 function boxError(id, msg) {
      document.getElementById(id).innerHTML = '<div style="background:#FF0000; color: #FFFFFF; padding:2px;">'+ msg +'</div>';
 }
 
 /*
    Show process info
 */
 function processLoading(id) {
	boxError(id, 'Sedang Proses...');
 }
 
 /*
    Clear all message status
 */
 function clearAllMessage() {
        var stf = document.getElementById('sendToFriend');
        var cn = document.getElementById('commentNews');
        var c = document.getElementById('comment');
        var rnli = document.getElementById('registerNewsLetterInfo');
        
        if (stf) stf.innerHTML = '';
        if (cn) cn.innerHTML = '';
        if (c) c.innerHTML = '';
        if (rnli) rnli.innerHTML = '';

        var stft = document.getElementById('sendToFriendTop');
        var cnt = document.getElementById('commentNewsTop');
        var ct = document.getElementById('commentTop');
        var rnlit = document.getElementById('registerNewsLetterInfoTop');
        
        if (stft) stft.innerHTML = '';
        if (cnt) cnt.innerHTML = '';
        if (ct) ct.innerHTML = '';
        if (rnlit) rnlit.innerHTML = '';

 }
 
function switchNewsTabTop(active) {
    
    var eleActive = document.getElementById(active);
    var valNow = eleActive.style.display;

    var f1 = document.getElementById('newsTopInfoEmail');
    var f2 = document.getElementById('newsTopInfoComment');
    var f3 = document.getElementById('newsTopInfoFans');
    var f4 = document.getElementById('newsTopInfoDaftar');

    //if ((eleActive == f2) || (eleActive == f3) || (eleActive == f4))
    //{
    //        checkMemberLoginTop();
    //}
    checkMemberLoginTop();
    
//    if (active == f1) resetCookieButton();
    
    if (f1) f1.style.display = "none";
    if (f2) f2.style.display = "none";
    if (f3) f3.style.display = "none";
    if (f4) f4.style.display = "none";
    
    clearAllMessage();
    
    if (valNow == "inline")
    {
        eleActive.style.display = "none";
    }
    else
    {
        eleActive.style.display = "inline";
    }
    
    /*
        first for send to friend
        second for newsletter KapanLagi
        third for news comment
        fourth for fans comment
    */
    //setEmailSender('cSenderTmp', 'cEmailTmp', 'nameFriendTop', 'emailFriendTop');
    //for (var i = 1; i <= 5; i++) setEmailSender('cDestNameTmp'+ i, 'cDestEmailTmp'+ i, 'recipientTop'+ i, 'remTop'+ i);
    
    //setEmailSender('cSenderTmp', 'cEmailTmp', 'nameNewsletterTop', 'emailNewsletterTop');
    //setEmailSender('cSenderTmp', 'cEmailTmp', 'commentNamaTop', 'commentEmailTop');
    //setEmailSender('cSenderTmp', 'cEmailTmp', 'namaFansTop', 'emailFansTop');
}

 function checkMemberLoginTop() {
    
    var member_email = readCookie("mbremface");
    var member_name = '';
 
    if (member_email != null)
    {
          member_email = decodeURIComponent(member_email);
 
          if (readCookie('mbrnmface') != null)
          {
                member_name = readCookie("mbrnmface");					
          }
 
          if (member_name == "" || member_name == null) 
          {
                member_name = member_email;
          }

          /* set name sender to cookie, set it to 30 minutes*/
          //createCookie2('cSenderTmp', member_name, 30);

          if (document.getElementById("newsTopInfoEmail"))
          {
                document.getElementById('topBoxSendToFriend').style.display = "none";
          }
          if (document.getElementById("newsTopInfoFans"))
          {
                document.getElementById('topBoxCelebFans').style.display = "none";
          }
          if (document.getElementById("newsTopInfoDaftar"))
          {
                document.getElementById('topBoxNewLetter').style.display = "none";
          }
          if (document.getElementById("newsTopInfoComment"))
          {
                document.getElementById('topBoxNewsComment').style.display = "none";
          }
    }
 }
 
 function sendToFriendDataTop(button) {
  
      var name = document.getElementById('nameFriendTop');
      var email = document.getElementById('emailFriendTop');
      var type = document.getElementById('typeTop').value;
      //var url = document.getElementById('urlTop').value;
      var flag = document.getElementById('flagTop').value;
      var allow = false;
      var allow2 = false;
      var copy = 0;
      if (document.getElementById('idcopyTop').checked)
      {
            copy = 1;
      }
      
      //if (!name || name.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
      //{
      //    boxError('sendToFriendTop', 'Nama tidak boleh kosong.');
      //    return false;
      //}
      //if (name.value != "") {
      //  /* set name sender to cookie, set it to 30 minutes*/
      //  //createCookie2('cSenderTmp', name.value, 30);
      //}
      //
      //if (!email || email.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
      //{
      //    boxError('sendToFriendTop', 'Email tidak boleh kosong.');
      //    return false;
      //}
      //
      //if (email.value != "") {
      //  /* set email to cookie, set it to 30 minutes*/
      //  //createCookie2('cEmailTmp', email.value, 30);
      //}
      
      var variable = 'action=send_to_friend&name='+ name.value +'&email='+ email.value +'&type='+ type +'&url='+ news_url +'&flag='+ flag +'&copy='+ copy;
      for (i = 1; i <= 5; i++)
      {
          var x = document.getElementById('recipientTop'+ i).value;
          variable += '&recipient'+ i +'='+ x;
          
          if (x != '')
          {
             // createCookie2('cDestNameTmp'+ i, x, 30);
              allow = true;
          }
      }
      for (i = 1; i <= 5; i++)
      {
          var y = document.getElementById('remTop'+ i).value;
          variable += '&rem'+ i +'='+ y;

          if (y != '')
          {
             // createCookie2('cDestEmailTmp'+ i, y, 30);
              allow2 = true;
          }
      }
      
      if ((! allow) || (! allow2))
      {
          boxError('sendToFriendTop', 'Nama dan Email tujuan tidak boleh kosong.');
          return false;
      }
    
    getDataService2('/u/news_service.php', variable, 'sendToFriendTop', 'newsTopInfoEmailForm', button);
    
    return true;
 }
 
 function newsCommentTop(button) {
    var words = document.getElementById('pesanNewsCommentTop').value;
    var splitWords = words.split(' ');
    var ssender = document.getElementById('commentNamaTop');
    var semail = document.getElementById('commentEmailTop');
    if(splitWords.length < 10 || words.length > 1000)
    {
        boxError('commentNewsTop', 'Komentar tidak boleh kurang dari 10 kata.')
    }
    //else if (ssender && ssender.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
    //{
    //    boxError('commentNewsTop', 'Nama tidak boleh kosong.');
    //}
    //else if (semail && semail.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
    //{
    //    boxError('commentNewsTop', 'Email tidak boleh kosong.');
    //}
    else
    {
        //if (ssender) {
        //        /* set name sender to cookie, set it to 30 minutes*/
        //        createCookie2('cSenderTmp', document.getElementById('commentNamaTop').value, 30);
        //        
        //        /* set email to cookie, set it to 30 minutes*/
        //        createCookie2('cEmailTmp', document.getElementById('commentEmailTop').value, 30);
        //}

        var nama_var = "";
        if (ssender) {
                nama_var = ssender.value;
        }
        var email_var = "";
        if (ssender) {
                email_var = semail.value;
        }
        var id_var = document.getElementById('commentIdNewsTop').value;
        var title_var = document.getElementById('commentTitleNewsTop').value;
        var pesan_var = document.getElementById('pesanNewsCommentTop').value
        
        getDataService2('/u/news_service.php','action=news_comment&nama='+ nama_var +'&email='+ email_var +'&id='+ id_var +'&title='+ encodeURIComponent(title_var) +'&pesan='+ encodeURIComponent(pesan_var), 'commentNewsTop', 'newsTopInfoCommentForm', button);
    }    
}

function registerNewsLetterDataTop(button) {
  
      var name = document.getElementById('nameNewsletterTop');
      var email = document.getElementById('emailNewsletterTop');
      var allow = false;
      
      if (name && name.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
      {
          boxError('registerNewsLetterInfoTop', 'Nama tidak boleh kosong.');
          return false;
      }
      
      var mbrnm = readCookie("mbrnmface");
      if (mbrnm == "" || mbrnm == null) {
        mbrnm = name.value;
      }
      
      if (mbrnm != "") {
        /* set name sender to cookie, set it to 30 minutes*/
        createCookie2('cSenderTmp', mbrnm, 30);
      }

      if (email && email.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
      {
          boxError('registerNewsLetterInfoTop', 'Email tidak boleh kosong.');
          return false;
      }
      if (email && email.value != "") {
        /* set name sender to cookie, set it to 30 minutes*/
        createCookie2('cEmailTmp', email.value, 30);
      }
      
      var variable = 'action=register_newsletter&name='+ mbrnm +'&email='+ email.value;
      for (i = 1; i <= 18; i++)
      {
          var x = document.getElementById('checkboxTop'+ i)
          if (x.checked)
             variable += '&checkbox'+ i +'='+ x.value;
          else
             variable += '&checkbox'+ i +'=';
          
          if (x.checked)
              allow = true;
      }
      
      if (! allow)
      {
          boxError('registerNewsLetterInfoTop', 'Pilih minimal satu kategori berita.');
          return false;
      }
      
    getDataService2('/u/news_service.php', variable, 'registerNewsLetterInfoTop', 'newsTopInfoDaftarForm', button);

    return true;
 }
 
 function newsFansCommentTop(button) {
    var words = document.getElementById('pesanTop').value;
    var splitWords = words.split(' ');
    var ssender = document.getElementById('namaFansTop');
    var semail = document.getElementById('emailFansTop');
    if(splitWords.length < 10 || words.length > 1000)
    {
        boxError('commentTop', 'Pesan tidak boleh kurang dari 10 kata.')
    }
    //else if (ssender && ssender.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
    //{
    //    boxError('commentTop', 'Nama tidak boleh kosong.');
    //}
    //else if (semail && semail.value == '' && (readCookie("mbremface") == null || readCookie("mbremface") == ""))
    //{
    //    boxError('commentTop', 'Email tidak boleh kosong.');
    //}
    else
    {
        //if (ssender && ssender.value != "") {
        //        /* set name sender to cookie, set it to 30 minutes*/
        //        createCookie2('cSenderTmp', document.getElementById('namaFansTop').value, 30);
        //}
        //
        //if (semail && semail.value != "") {
        //        /* set name sender to cookie, set it to 30 minutes*/
        //        createCookie2('cEmailTmp', document.getElementById('emailFansTop').value, 30);
        //}

        var nama_var = ""
        if (ssender) nama_var = ssender.value;
        var email_var = "";
        if (semail) email_var = semail.value;
        var artis_var =  document.getElementById('newsArtistTop').value;
        var pesan_var = document.getElementById('pesanTop').value;
        
        //if(email_var=='murry_ho@yahoo.com'){
            //alert('hai');
        //}else{
            getDataService2('/u/news_service.php','a=1&action=selebriti_comment&status=0&nama='+ nama_var +'&email='+ email_var +'&artis='+ artis_var +'&pesan='+ pesan_var, 'commentTop', 'newsBottomInfoFansFormTop', button);
        //}        
        
    }
}


var TopMenu = '<div style="clear: both; padding: 1px 3px 10px 5px; text-align: left;">';
/*
TopMenu += '<div style="padding: 3px; float: left;">';
TopMenu += '        <a href="javascript:void(0);" onclick="javascript: switchNewsTabTop(\'newsTopInfoComment\');"><img src="http://www.kapanlagi.com/i/v3/beri_komentar.png" alt="Beri Komentar" title="Beri Komentar" style="border: 0px;" /></a>';
TopMenu += '    </div>';
TopMenu += '    <div style="padding: 3px; float: left;">';
TopMenu += '        <a href="javascript:void(0);" onclick="javascript: switchNewsTabTop(\'newsTopInfoDaftar\');"><img src="http://www.kapanlagi.com/i/v3/daftar_mailing_list.png" alt="Daftar Newsletter" title="Daftar Newsletter" /></a>';
TopMenu += '    </div>';
TopMenu += '    <div style="padding: 3px; float: left;">';
TopMenu += '        <a href="javascript:void(0);" onclick="javascript: switchNewsTabTop(\'newsTopInfoEmail\');"><img src="http://www.kapanlagi.com/i/v3/email2pren.png" alt="Kirim Email ke Teman" title="Kirim Email ke Teman" /></a>';
TopMenu += '    </div>';

if (have_artist)
{
   TopMenu += '<div style="padding: 3px; float: left;">';
   TopMenu += '    <a href="javascript: void(0);" onclick="javascript: switchNewsTabTop(\'newsTopInfoFans\');"><img src="http://www.kapanlagi.com/i/v3/fans.png" alt="Kirim Komentar Ke Fans" title="Kirim Komentar Ke '+ artist_name +'" /></a>';
   TopMenu += '</div>';
}
*/
TopMenu += '<div style="clear: both;"></div>';
TopMenu += '	<div style="float: left; display: none; border: 1px solid #666666;" id="newsTopInfoEmail">';
TopMenu += '	  <div style="padding: 0px; width: 330px;">';
TopMenu += '	    <div style="padding: 10px; font-weight:bold;text-align:center; background-color: #ededed;">KIRIM EMAIL KE TEMAN</div>';
TopMenu += '	    <div style="padding: 10px;">Informasikan ke teman-teman Anda mengenai berita di bawah melalui email.</div>';
TopMenu += '	    <div style="padding: 8px;">';
TopMenu += '	      <form action="/u/sendtofriend.php" method="post" target="subscribe" onSubmit="return false;" id="newsTopmInfoEmailForm">';
TopMenu += '            <div id="topBoxSendToFriend">';
TopMenu += '	        <div style="float:left; margin:2px">Nama Anda</div>';
TopMenu += '	        <div style="float:right;text-align:right; margin:2px;" id="nameFriendTopPar"><input style="width:150px" type="text" name="name" id="nameFriendTop" value=""></div>';
TopMenu += '	        <div style="clear: both; width: 120px; float:left; margin:2px">Alamat Email Anda</div>';
TopMenu += '	        <div style="float:right;text-align:right; margin:2px;" id="emailFriendTopPar"><input style="width:150px" type="text" name="email" id="emailFriendTop" value=""></div>';
TopMenu += '	        <div style="clear: both;"></div>';
TopMenu += '	        <br /></div>';
TopMenu += '	        <div style="clear: both; text-align:center; margin: 3px;font-weight:bold;">Kirim Ke</div>';
TopMenu += '	        <div style="float:left; padding-left: 10px;">Nama</div>';
TopMenu += '	        <div style="float:right;text-align:right; padding-right: 10px;">Email</div>';
TopMenu += '	        <br style="clear: both;" />';
TopMenu += '                <div style="float:left;margin:1px;"><input style="width:135px" type="text" name="recipientTop1" id="recipientTop1" value=""></div><div style="float:right;margin:1px;text-align:right;"><input style="width:140px" type="text" name="remTop1" id="remTop1" value=""></div><div style="float:left;margin:1px;"><input style="width:135px" type="text" name="recipientTop2" id="recipientTop2" value=""></div><div style="float:right;margin:1px;text-align:right;"><input style="width:140px" type="text" name="remTop2" id="remTop2" value=""></div><div style="float:left;margin:1px;"><input style="width:135px" type="text" name="recipientTop3" id="recipientTop3" value=""></div><div style="float:right;margin:1px;text-align:right;"><input style="width:140px" type="text" name="remTop3" id="remTop3" value=""></div><div style="float:left;margin:1px;"><input style="width:135px" type="text" name="recipientTop4" id="recipientTop4" value=""></div><div style="float:right;margin:1px;text-align:right;"><input style="width:140px" type="text" name="remTop4" id="remTop4" value=""></div><div style="float:left;margin:1px;"><input style="width:135px" type="text" name="recipientTop5" id="recipientTop5" value=""></div><div style="float:right;margin:1px;text-align:right;"><input style="width:140px" type="text" name="remTop5" id="remTop5" value=""></div>';
TopMenu += '	        <br style="clear:both;" />';
TopMenu += '	        <br />';
TopMenu += '                <div id="sendToFriendTop"></div>';
TopMenu += '	        <div style="float:left; padding-top: 5px;">';
TopMenu += '	          <div style="float:left;text-align:left; width:260px;">';
TopMenu += '                        <input type="checkbox" name="copyTop" id="idcopyTop" value=1 checked /> kirim copy ke email saya';
TopMenu += '                  </div>';
TopMenu += '                  <br style="clear: both;" />';
TopMenu += '	        </div>';
TopMenu += '                <div style="clear: both;"></div>';
TopMenu += '                <div style="width: 100%; padding-top: 10px; text-align: right;">';
TopMenu += '                             <input type=hidden name="typeTop" id="typeTop" value="news">';
//TopMenu += '                             <input type=hidden name="urlTop" id="urlTop" value="'+ news_url +'">';
TopMenu += '                             <input type=hidden name="flagTop" id="flagTop" value="true">';
TopMenu += '                             <input type="button" value="Tutup form ini" onclick="javascript: document.getElementById(\'newsTopInfoEmail\').style.display = \'none\';" />';
TopMenu += '                             <input value="Kirim"  onclick="javascript: sendToFriendDataTop(this);" type="submit" />';
TopMenu += '                       </div>';
TopMenu += '	        <br style="clear:both;" />';
TopMenu += '	      </form>';
TopMenu += '	    </div>';
TopMenu += '	  </div>';
TopMenu += '	</div>';
TopMenu += '	<div style="float: left; display: none; border: 1px solid #666666;" id="newsTopInfoComment">';
TopMenu += '                    <form id="newsTopInfoCommentForm">';
TopMenu += '	  <div style="padding: 0px; width: 330px;" id="mainCommentNewsTop">';
TopMenu += '	    <div style="padding: 10px; font-weight:bold;text-align:center; background-color: #ededed;">KOMENTAR PEMBACA</div>';
TopMenu += '	    <div style="padding: 10px;">';
TopMenu += '	      Berikan komentar Anda untuk berita di bawah.<br />';
TopMenu += '	      Komentar akan ditampilkan di halaman ini, diharapkan sopan dan bertanggung jawab.';
TopMenu += '	    </div>';
TopMenu += '        <div style="padding: 8px;">';
TopMenu += '        <div id="topBoxNewsComment">';
TopMenu += '                       <div style="clear: both; text-align: left; padding-top: 8px;">';
TopMenu += '	    	    <div style="float: left; width: 75px;">Nama Anda</div>';
TopMenu += '	            <div style="float: left;" id="commentLine2">:&nbsp;</div>';
TopMenu += '	    	    <div id="commentLineName" style="float: left;"><input style="width: 210px ! important;" name="namaNewsCommentTop" id="commentNamaTop" type="text"></div>';
TopMenu += '	        </div>';
TopMenu += '	        <div id="commentLineEmailPar" style="clear: both; text-align: left; padding-top: 1px;">';
TopMenu += '	    	    <div style="float: left; width: 75px;">Email Anda</div>';
TopMenu += '	    	    <div style="float: left;" id="commentLine1">:&nbsp;</div>';
TopMenu += '	    	    <div id="commentLineEmail" style="float: left;"><input style="width: 210px ! important;" name="emailNewsCommentTop" id="commentEmailTop" type="text"></div>';
TopMenu += '	        </div>';
TopMenu += '        </div>';
TopMenu += '	        <div style="clear: both; padding-top: 1px;" id="lineMessage">';
TopMenu += '	  		<div style="float: left; width: 75px;">Komentar</div>';
TopMenu += '	  		<div style="float: left;">:&nbsp;</div>';
TopMenu += '	  		<div style="float: left;"><textarea style="width:210px;" rows="5" name="pesanNewsCommentTop" id="pesanNewsCommentTop"></textarea></div>';
TopMenu += '	  	</div>';
TopMenu += '	  	<div style="clear: both;"></div>';
TopMenu += '	  	<div style="padding: 5px 0px 0px 90px; clear: both;">';
TopMenu += '	  		<span style="font-size: 11px;">KapanLagi.com berhak menghapus komentar yang tidak layak ditampilkan</span><br><br>';
TopMenu += '	  	</div>';
TopMenu += '                       <div id="commentNewsTop"></div>';
TopMenu += '                       <div style="padding-top: 5px; text-align: right;">';
TopMenu += '                           <input type="hidden" name="commentIdNewsTop" id="commentIdNewsTop" value="'+ news_id +'" />';
TopMenu += '                           <input type="hidden" name="commentTitleNewsTop" id="commentTitleNewsTop" value="'+ news_title +'" />';
TopMenu += '                           <input type="button" value="Tutup form ini" onclick="javascript: document.getElementById(\'newsTopInfoComment\').style.display = \'none\';" />';
TopMenu += '                           <input name="submitNewsComment" value="   Kirim   " onclick="javascript: newsCommentTop(this);" type="button">';
TopMenu += '                       </div>';
TopMenu += '                    </div>';
TopMenu += '	 </div>';
TopMenu += '                   </form>';
TopMenu += '	</div>';

if (have_artist)
{
    TopMenu += '<div style="float: left; display: none; border: 1px solid #666666;" id="newsTopInfoFans">';
    TopMenu += '                   <form id="newsTopInfoFansForm">';
    TopMenu += '	  <div style="padding: 0px; width: 330px;" id="mainCommentTop">';
    TopMenu += '	    <div style="font-weight:bold; padding: 10px; text-align:center; background-color: #ededed;">KOMENTAR FANS '+ artist_name +'</div>';
    TopMenu += '	    <div style="padding: 10px;">';
    TopMenu += '	      Anda fans <a href="http://selebriti.kapanlagi.com/'+ artist_url +'"><b>'+ artist_name +'</b></a>? Berikan komentar Anda.';
    TopMenu += '	      Komentar akan ditampilkan di halaman biografi <a href="http://selebriti.kapanlagi.com/'+ artist_url +'"><b>'+ artist_name +'</b></a>, diharapkan sopan dan bertanggung jawab.';
    TopMenu += '	    </div>';
    TopMenu += '            <div style="padding: 8px;">';
    TopMenu += '            <div id="topBoxCelebFans">';
    TopMenu += '                   <div style="clear: both; text-align: left; padding-top: 8px;">';
    TopMenu += '                    <div style="float:left; width:75px;">Nama Anda</div>';
    TopMenu += '                    <div style="float:left;" id="line2">:&nbsp;</div>';
    TopMenu += '                    <div style="float:left;" id="lineName"><input style="width:210px !important; width:200px;" type="text" name="namaTop" id="namaFansTop" /></div>';
    TopMenu += '	           </div>';
    TopMenu += '	           <div id="fansCommentPar" style="clear: both; text-align: left; padding-top: 1px;">';
    TopMenu += '                    <div style="float:left; width:75px;">Email Anda</div>';
    TopMenu += '                    <div style="float:left;" id="line1">:&nbsp;</div>';
    TopMenu += '                    <div style="float:left;" id="lineEmail"><input style="width:210px !important; width:200px;" type="text" name="emailTop" id="emailFansTop" /></div>';
    TopMenu += '	           </div>';
    TopMenu += '	    </div>';
    TopMenu += '	    <div style="clear: both; padding-top: 1px;" id="lineMessage">';
    TopMenu += '	    	<div style="float: left; width: 75px;">Pesan</div>';
    TopMenu += '	    	<div style="float: left;">:&nbsp;</div>';
    TopMenu += '	    	<div style="float: left;"><textarea style="width:210px;" rows="5" name="pesanTop" id="pesanTop"></textarea></div>';
    TopMenu += '	    </div>';
    TopMenu += '	    <div style="clear: both;"></div>';
    TopMenu += '	    <div style="padding: 5px 0px 0px 90px; clear: both;">';
    TopMenu += '	    	<span style="font-size: 11px;">KapanLagi.com berhak menghapus komentar yang tidak layak ditampilkan</span><br /><br />';
    TopMenu += '	    </div>';
    TopMenu += '                   <div id="commentTop"></div>';
    TopMenu += '                   <div style="padding-top: 5px; text-align: right;">';
    TopMenu += '                       <input type="hidden" name="newsArtist" id="newsArtistTop" value="'+ artist_name +'" />';
    TopMenu += '                       <input type="button" value="Tutup form ini" onclick="javascript: document.getElementById(\'newsTopInfoFans\').style.display = \'none\';" />';
    TopMenu += '                       <input name="submitNewsCommentTop" value="   Kirim   " onclick="javascript: newsFansCommentTop(this);" type="button" />';
    TopMenu += '                   </div>';
    TopMenu += '                   </div>';
    TopMenu += '	  </div>';
    TopMenu += '                   </form>';
    TopMenu += '	</div>';
}

TopMenu += '           <div style="float: left; display: none; border: 1px solid #666666;" id="newsTopInfoDaftar">';
TopMenu += '	  <div style="padding: 0px; width: 330px;">';
TopMenu += '	  	<div style="padding: 10px; font-weight:bold;text-align:center; background-color: #ededed;">NEWSLETTER KAPANLAGI.COM</div><br />';
TopMenu += '	    <div style="padding: 10px;">Dapatkan berita terbaru di email Anda setiap hari.</div><br />';
TopMenu += '	  	<div style="padding: 8px;">';
TopMenu += '	  		<form method="post" action="http://www.kapanlagi.com/u/savesubscribe.php" target="subscribe" id="newsTopInfoDaftarForm" onSubmit="return false;">';
TopMenu += '                        <div id="topBoxNewLetter">';
TopMenu += '	  			<div style="float: left; padding-left: 5px; padding-right: 3px;" id="newsLetterFullName">Nama:<br /><input style="width:140px" name="nameNewsletterTop" id="nameNewsletterTop" type="text"></div>';
TopMenu += '	  			<div style="padding-right: 5px; float: right;" id="newsLetterFullEmail">Email:<br /><input style="width:150px" name="emailNewsletterTop" id="emailNewsletterTop" type="text" maxlength="32"><input value="1" name="flagTop" type="hidden"></div>';
TopMenu += '	  			<div id="newsLetterBr" style="clear:both;"><br style="clear:both;" />';
TopMenu += '	  			<br /></div></div>';
TopMenu += '	  			<div style="font-weight:bold;">Kategori berita yang diinginkan:</div><br />';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop1" value="46" /> Selebriti</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop2" value="40" /> Film</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop3" value="41" /> Musik</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop4" value="42" /> Televisi</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop5" value="43" /> Hollywood</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop6" value="44" /> Bollywood</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop7" value="45" /> Asian Star</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop8" value="47" /> Sinetron</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop9" value="32" /> Bola Internasional</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop10" value="31" /> Bola Nasional</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop11" value="33" /> Seleb-OR</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop12" value="30" /> Olahraga Lain-lain</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop13" value="50" /> Hukum-Kriminal</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop14" value="52" /> Kasus Narkoba</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop15" value="10" /> Politik Nasional</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop16" value="11" /> Politik Internasional</div>';
TopMenu += '	  			<div style="width:145px;float:left;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop17" value="20" /> Ekonomi Nasional</div>';
TopMenu += '	  			<div style="width:165px;float:right;padding:2px 0px;"><input name="pilihcat[]" type="checkbox" id="checkboxTop18" value="21" /> Ekonomi Internasional</div>';
TopMenu += '	  			<br style="clear:both" />';
TopMenu += '	  			<br />';
TopMenu += '                             <div id="registerNewsLetterInfoTop"></div>';
TopMenu += '	  			<div style="clear: both; text-align: right; padding-top: 5px;">';
TopMenu += '                                           <input type="button" value="Tutup form ini" onclick="javascript: document.getElementById(\'newsTopInfoDaftar\').style.display = \'none\';" />';
TopMenu += '                                           <input value="    Daftar    " name="B1" class="button" onclick="javascript: registerNewsLetterDataTop(this);" type="submit">';
TopMenu += '                                       </div>';
TopMenu += '	  		</form>';
TopMenu += '	  	</div>';
TopMenu += '	  </div>';
TopMenu += '	</div>';
TopMenu += '               <div style="clear: both;"></div>';
TopMenu += '            </div>';


document.write(TopMenu);