
// JavaScript Document

//
//
function creatediv(id, html, width, height, left, top) {
   var newdiv = document.createElement('div');
   newdiv.setAttribute('id', id);
   newdiv.style.zIndex=99999;

   if ((left || top) || (left && top)) {
       newdiv.style.position = "absolute";
   }
	   if( typeof( window.pageYOffset) == 'number' ) {
		newdiv.style.width='500px';
		newdiv.style.left=(window.pageXOffset+window.innerWidth/2-parseInt(newdiv.style.width)/2)+'px';
		newdiv.style.top=(window.pageYOffset+200)+'px';
	   	newdiv.style.textAlign="center";
   		newdiv.style.background = "#CCCCCC";
   		newdiv.style.border = "4px solid #000000";
	   }else{
		newdiv.style.width='500px';
		newdiv.style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth/2-parseInt(newdiv.style.width)/2)+'px';
		newdiv.style.top=(document.documentElement.scrollTop+200)+'px';
		newdiv.style.textAlign="center";
   		newdiv.style.background = "#CCCCCC";
   		newdiv.style.border = "4px solid #000000";
		}
	   
	   
   if (html) {
       newdiv.innerHTML = html;
   } else {
       newdiv.innerHTML = "nothing";
   }
   document.body.appendChild(newdiv);

} 

function removeDiv(olddiv)
{
if(olddiv=="mp3"){
try{
		  div = document.getElementById(olddiv);
		  div1 = document.getElementById('_RANDOM_ID_');
   		  div1.SetVariable("closePlayer", 1);
			document.body.removeChild(div);
	}catch(err){}
}else{
	try{
  div = document.getElementById(olddiv);
  document.body.removeChild(div);
	}
	catch(err){
		}
	}
}

function crt_popout(crt_id)
{
	removeDiv('crt');
	var myWidth=0;
	var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
if(crt_id.charAt(0)==6 || crt_id.charAt(0)==8){
var html="<div class='crtpop_header' style='padding:10px'><div style='position:relative;float:left'><img src='image/crt/celcom.png'/></div><div style='position:relative'><div style='float:right; position:absolute; right:10px; padding:5px; z-index:9999; font-size:14px; color:#FFFFFF'><a href=\"javascript:removeDiv('crt')\">Tutup</a></div><table border='0' width='380px'><tr bgcolor='#000000'><td colspan='2' style='font-size:18px;text-align:left;color:#CADB2A;'>Cara Muat Turun &amp; Caj</td></tr><tr bgcolor='#ABE1FA'><td style='text-align:left;font-size:12px; font-weight:bold'>Caj Bulanan: RM3.00</td><td style='font-size:12px;text-align:right;font-weight:bold'>Caj Per Muat Turun: RM3.50</td></tr></table></div></div><div class='crtpop_content'style='padding-bottom:10px' align='center'><table style='padding:10px'><tr><td style='text-align:left; font-size:14px; color:#2E3192'><b>Aktifkan Akaun</b></td><td>&nbsp;</td><td>SMS <b>CMT ON</b> hantar ke <b>22990</b></td></tr><tr><td background='image/crt/crt_hp.png' style='background-repeat:no-repeat;text-align:center;' width='200px' height='54px'><b>CMT ON</b></td><td><img src='image/crt/crt_arow.png' /></td><td background='image/crt/crt_hp.png' style='background-repeat:no-repeat; text-align:center' width='200px' height='54px'><b>22990</b></td></tr><tr><td  style='text-align:left; font-size:14px; color:#2E3192'><b>Untuk Muat Turun</b></td><td>&nbsp;</td><td>SMS <b>CMT &lt;kod&gt;</b> hantar ke <b>22990</b> <br/> cth: CMT  "+crt_id+"</td></tr><tr><td background='image/crt/crt_hp.png' style='background-repeat:no-repeat;text-align:center;' width='200px' height='54px'><b>CMT "+crt_id+"</b></td><td><img src='image/crt/crt_arow.png' /></td><td background='image/crt/crt_hp.png' style='background-repeat:no-repeat; text-align:center' width='200px' height='54px'><b>22990</b></td></tr></table><p>Untuk henti, hubungi 03-3630 8888 </p></div>";	
}else{
var html="<div class='crtpop_header' style='padding:10px'><div style='position:relative;float:left'><img src='image/crt/maxis.png'/></div><div style='position:relative'><div style='float:right; position:absolute; right:10px; padding:5px; z-index:9999; font-size:14px; color:#FFFFFF'><a href=\"javascript:removeDiv('crt')\">Tutup</a></div><table border='0' width='380px'><tr bgcolor='#000000'><td colspan='2' style='font-size:18px;text-align:left;color:#CADB2A;'>Cara Muat Turun &amp; Caj</td></tr><tr bgcolor='#ABE1FA'><td style='text-align:left;font-size:12px; font-weight:bold'>Caj Bulanan: RM2.00</td><td style='font-size:12px;text-align:right;font-weight:bold'>Caj Per Muat Turun: RM3.00</td></tr></table></div></div><div class='crtpop_content'style='padding-bottom:10px' align='center'><table border='0' width='400px'><tr><td style='text-align:left; font-size:14px; color:#2E3192'><b>Aktifkan Akaun</b></td><td style='text-align:left'>Dail <b>*131#</b> tekan <font color='#FF0000'><b>Call/Send</b></font></td></tr><tr><td>&nbsp;</td> <td background='image/crt/crt_hp_maxis.png' style='background-repeat:no-repeat; text-align:center';text-align:center; width='200px' height='59px'><b>*131#</b></td></tr><tr><td style='text-align:left; font-size:14px; color:#2E3192'><b>Untuk Muatan Turun</b></td><td style='text-align:left'>Dail <b>*131* &lt;kod&gt;#</b> tekan <b>Call/Send</b><br/>cth: *131*"+crt_id+"#</td></tr><tr><td>&nbsp;</td><td background='image/crt/crt_hp_maxis.png' style='background-repeat:no-repeat;text-align:center;' width='200px' height='59px'><b>*131*"+crt_id+"#</b></td></tr><tr><td style='text-align:left; font-size:14px; color:#2E3192'><b>Untuk Henti</b></td><td style='text-align:left'>Dail <b>#131#</b> tekan <b>Call/Send</b></td></tr><tr><td>&nbsp;</td><td background='image/crt/crt_hp_maxis.png' style='background-repeat:no-repeat; text-align:center' width='200px' height='59px'><b>#131#</b></td></tr></table></div>";
}
creatediv("crt",html,1,1,myWidth,myHeight);
}

function song_popout()
{
removeDiv('song');
	var myWidth=0;
	var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
var html="<div style=\"padding:10px;\"><div style=\"position:absolute; right:20px; float:right;\"><a href=\"javascript:removeDiv('song')\"><b>Tutup</b></a></div><p style=\"font-size:16px; padding-top:5px; text-align:left; color:#330099\"><b>Cara Mengundi Melalui SMS";
html=html+"</b></p><p style=\"font-size:14px; text-align:left; padding-top:10px; \">Taip <b>UNDI</b> &lt;jarak&gt; <b>kod lagu</b> hantar ke <b>32200</b><img style=\"vertical-align:middle; padding-left:5px;\"; src=\"image/song/undi50.png\"/></p><img style=\"padding-top:10px;\" src=\"image/song/undi123.png\"/> <hr width='376px'/><p style='text-align:left;'>* Kadar caj biasa telco dikenakan</p>";	
creatediv("song",html,1,1,myWidth,myHeight);	  
}

function showResult(type,URL,Song)
{
var id;
if(type=='song')
	{
	removeDiv('mp3');
	id='mp3';
	var html="<p align=\"right\"><a href=\"javascript:removeDiv('";																					
	html=html+id;
	html=html+"')\"><b>Close</b></a></p>";
	html=html+"<script language='JavaScript' src='image/audio-player.js'></script><object type='application/x-shockwave-flash' data='image/player.swf' id='_RANDOM_ID_' height='24' width='290'><param name='movie' value='image/player.swf'><param name='FlashVars' value='playerID=_RANDOM_ID_&amp;soundFile=";
	html=html+URL;
	html=html+"&amp;autostart=yes'><param name='quality' value='high'><param name='menu' value='true'><param name='wmode' value='transparent'></object><br/>"+Song;
	
	var myWidth=0;
	var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	}else if(type=='mp3')
	{
	removeDiv('mp3');
	id='mp3';
	var url1="http://kawanlah.com/home/musics/"+URL+".mp3";
	var html="<p align=\"right\"><a href=\"javascript:removeDiv('";																					
	html=html+id;
	html=html+"')\"><b>Tutup</b></a></p>";
	html=html+"<script language='JavaScript' src='image/audio-player.js'></script><object type='application/x-shockwave-flash' data='image/player.swf' id='_RANDOM_ID_' height='24' width='290'><param name='movie' value='image/player.swf'><param name='FlashVars' value='playerID=_RANDOM_ID_&amp;soundFile=";
	html=html+url1;
	html=html+"&amp;autostart=yes'><param name='quality' value='high'><param name='menu' value='true'><param name='wmode' value='transparent'></object><br/>"+Song;
	
	var myWidth=0;
	var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	}else if(type=='cara')
	{
	removeDiv('Cinta');
	removeDiv('Gadis');
	removeDiv('Cute');
		if(URL==1)
		{
		id='Cinta';
		var url='cara_1';
		var url1='cara_2';
		var title='WallPaper';
		var tp='ON PT CINTA';
		var tp1='&lt;kod&gt;';
		}else if(URL==2)
		{
		id='Gadis';
		var url='cara_3';
		var url1='cara_4';
		var title='WallPaper';
		var tp='ON PT GADIS';
		var tp1='&lt;kod&gt;';
		}else if(URL==3)
		{
		id='Cute';
		var url='cara_5';
		var url1='cara_6';
		var title='WallPaper';
		var tp='ON PT CUTE';
		var tp1='&lt;kod&gt;';
		}else if(URL==4)
		{
		id='Lucu';
		var url='cara_7';
		var url1='cara_8';
		var title='Nada Dering';
		var tp='ON FT';
		var tp1='&lt;kod&gt;';
		}
		
		
		var html="<div style=\"padding:10px;\"><div style=\"position:absolute; right:20px; float:right;\"><a href=\"javascript:removeDiv('"+id+"')\"><b>Tutup</b></a></div><p style=\"font-size:16px; padding-top:5px; text-align:left; color:#330099\"><b>Cara Melanggan ";
		html=html+title+" "+id+"</b></p><p style=\"font-size:14px; text-align:left; padding-top:10px; \">Taip <b>"+tp+"</b> hantar ke <b>37888</b><img style=\"vertical-align:middle; padding-left:5px;\"; src=\"image/mms/downloadLink.png\"/></p><img style=\"padding-top:10px;\" src=\"image/mms/"+url+".png\"/> <hr width='376px'/><p style=\"font-size:14px; text-align:left; padding-top:10px; \">Untuk <b>"+title+" "+id+"</b> tertentu, hantar <b>GET "+tp1+" \<kod\></b> ke 37888</p><img src=\"image/mms/"+url1+".png\"/>";	
		var myWidth=0;
		var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	}else if(type=='Nada'){
		  id='Nada';
		var url='nada_1';
		var title='Dering MP3';
		var tp='ON RT';
		  var html="<div style=\"padding:10px;\"><div style=\"position:absolute; right:20px; float:right;\"><a href=\"javascript:removeDiv('"+id+"')\"><b>Tutup</b></a></div><p style=\"font-size:16px; padding-top:5px; text-align:left; color:#330099\"><b>Cara Melanggan "+id+" "+title+"</b></p><p style=\"font-size:14px; text-align:left; padding-top:10px; \">Taip <b>"+tp+"</b> hantar ke <b>37888</b><img style=\"vertical-align:middle; padding-left:10px;\"; src=\"image/mms/downloadLink.png\"/></p><img style=\"padding-top:10px;\" src=\"image/mms/"+url+".png\"/>";
		var myWidth=0;
		var myHeight=0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		
		  }
	}
	  creatediv(id,html,1,1,myWidth,myHeight);

}
