
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
//  document.Show.MouseX.value = tempX
//  document.Show.MouseY.value = tempY
  return true
}
function clickIE4(){
if (event.button==2){
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("return false")

var idtimemenu;
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
    function moveXbySlicePos (x, img) { 
			if (!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
			par = macIE45 ? par.parentElement : par.offsetParent;
			}
		} else if (img.x) x += img.x;		
			return x;
		}	
		
		function moveYbySlicePos (y, img) {
	if(!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	} else if (img.y >= 0) y += img.y;
	return y;
}
function changestate(stateurl){
	document.getElementById("state").value=stateurl;
}
function changeImage(tipe,strPath)
{
	if(tipe==1){			
		document.getElementById("imgNew").src=strPath+"images/tab_New10_2.gif";
		document.getElementById("imgTop").src=strPath+"images/tab_Top10_1.gif";
		document.getElementById("tblTop").style.display='';
		document.getElementById("tblNew").style.display='none';
	}
	else {		
		document.getElementById("imgNew").src=strPath+"images/tab_New10_1.gif";
		document.getElementById("imgTop").src=strPath+"images/tab_Top10_2.gif";
		document.getElementById("tblTop").style.display='none';
		document.getElementById("tblNew").style.display='';
	}
}
function tooltipShow(text)
{
	var ximage = tempX;
	var yimage = tempY+20;	
	document.getElementById("ImageToolTip").innerHTML="&nbsp;"+text+"&nbsp;";
	document.getElementById("ImageToolTip").style.display='';			
	document.getElementById("ImageToolTip").style.left=ximage+"px";
	document.getElementById("ImageToolTip").style.top=yimage+"px";
	document.getElementById("ImageToolTip").style.display='';	
}
function tooltipHide()
{
	document.getElementById("ImageToolTip").style.display='none';
}
function ShowMenu()
{		
		var x;
		var y;
		x=moveXbySlicePos(0,document.getElementById("eventimage"))+110;
		y=moveYbySlicePos(0,document.getElementById("eventimage"))-11;		 
		clearTimeout(idtimemenu);				
		document.getElementById("divMenu").style.display='';		
		document.getElementById("divMenu").style.left=x+"px"
		document.getElementById("divMenu").style.top=y+"px"
		
}
function HideMenu()
{
		document.getElementById("divMenu").style.display='none';
}
function LoadFirst()
{				
		document.getElementById('tblTop').style.display='';
		document.getElementById('tblNew').style.display='none';		
}
 function trim(str)
		{
		   return str.replace(/^\s*|\s*$/g,"");
		}
 function OpenWindowBuying(title,artist,type,mcode,strPath,language)
    	
    	{       title=trim(title);
    			artist=trim(artist);
    			
    			var w = window.open(strPath+"page/prelistening.jsp?mcode="+mcode+"&path="+Path+"&title="+title+"&artist="+ artist+"&lang=" +language, "winPlayer", "height=548,width=349");
  				//var w = window.open (strPath+"page/BuyingMain.jsp?mcode="+mcode+"&type="+type+"&title="+title+"&artist="+ artist+"&lang=" +language, "win", "height=430,width=400");
  				w.focus();
    	}     	
    	function OpenPlayersong(Path,title,artist,mcode,strPath, language)
		{		
			title=trim(title);
   			artist=trim(artist);
			var w = window.open(strPath+"page/prelistening.jsp?mcode="+mcode+"&path="+Path+"&title="+title+"&artist="+ artist+"&lang=" +language, "winPlayer", "height=548,width=349");		
			w.focus();
		}
    function trim(str)
		{
		   return str.replace(/^\s*|\s*$/g,"");
		}
		function OpenWindowBuyingDetail(title,artist,mcode,strPath,language)
    	{       		  
    		  title=trim(title);
    			artist=trim(artist);
    			if(document.all("rblFeature")[0].checked)
    				Code="Gift";
    			if(document.all("rblFeature")[1].checked)
    				Code="Kantor";
    			if(document.all("rblFeature")[2].checked)
    				Code="Default";    				
    			if(document.all("rblFeature")[3].checked)
    				Code="Spesial";
    			if(document.all("rblFeature")[4].checked)
    				Code="CallerID1";	
    			if(document.all("rblFeature")[5].checked)
    				Code="CallerID2";
    			if(document.all("rblFeature")[6].checked)
    				Code="CallerID3";
    			if(document.all("rblFeature")[7].checked)
    				Code="CallerID4";
    			if(document.all("rblFeature")[8].checked)
    				Code="CallerID5";
    			if(document.all("rblFeature")[9].checked)
    				Code="Pagi";
    			if(document.all("rblFeature")[10].checked)
    				Code="Siang";
    			if(document.all("rblFeature")[11].checked)
    				Code="Sore";
    				
  				var w = window.open(strPath+"page/BuyingDetail.jsp?mcode="+mcode+"&Code="+Code+"&title="+title+"&artist="+ artist+"&lang=" + language, "win", "height=410,width=350");
    	}    
    	
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
