///////////////////////////////////////
// AUTHOR : LINA PHAM
// (C) COPYRIGHT 
// WWW.LCMUSIC.NET
// ADMIN@LCMUSIC.NET
///////////////////////////////////////
//--- Set Image --- ///////////
function setImage(cat)
{
    var imageURL = "images/title_"+cat+".jpg";

    //document.titleImage.src = imageURL;

}
//--- Goto --- ///////////////
function goTo(url)
{

   window.location.href=url;

}

//--- IMAGE ARRAYS --- ////////////

var myImages = new Array();
var base= "images/"
var nrm = new Array();
var omo = new Array();

// Pre-load part.
if (document.images)
{
	for (i=0;i<myImages.length;i++)
	{
		nrm[i] = new Image;
		nrm[i].src = base + myImages[i] + "_off.jpg"
		omo[i] = new Image;
		omo[i].src = base + myImages[i] + "_on.jpg";	
	}
}


// The functions: first mouseover, then mouseout
function over(myImage)
{
      
        var name = myImage.name;
        
        document.images[name].src = "/loanchau/images/"+myImage.name+"_on.gif";


}

function out(myImage)
{
	
        var name = myImage.name;
        document.images[name].src = "/loanchau/images/"+myImage.name+"_off.gif";

		
	
}


//-- HOVER image (src, hsrc)
function hover() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}



//-- CUSTOMIZED POPUP
var W=window.screen.width;
var H=window.screen.height;

function popUp(URL,w,h,scroll,resize) {
day = new Date();
//id = day.getTime();
//id = URL.substring(0,URL.indexOf(".php"));
id = w+h;

var X=Math.ceil((W-w)/2)
var Y=Math.ceil((H-h)/2)



eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars="+scroll+",location=0,statusbar=0,menubar=0,resizable="+resize+",width="+w+",height="+h+",left ="+X+",top = "+Y+"');");
}

//-- PHOTOS POPUP
function openImage(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function  viewFoto(img){
  var day = new Date();
  var id = day.getTime();
  w=foto1.width+50;
  h=foto1.height+65;
  X = Math.ceil((W-w)/2);
  Y = Math.ceil((H-h)/2);
  var prop = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left ="+X+",top = "+Y;
  stringa="width="+w+",height="+h+",left="+X+",top="+Y;

  var myWin=window.open("", id, stringa);
  myWin.document.write("<HTML>")
  myWin.document.write("<TITLE>WWW.LCMUSIC.NET</TITLE>")
  myWin.document.write("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"/loanchau/includes/lcv7bstyle.css\">");
  myWin.document.write("<BODY bgcolor=eeeeee leftmargin=0 topmargin=0 onMouseDown=\"self.close();\">")
  myWin.document.write("<CENTER><br>");
  myWin.document.write("<table class=tdPic cellpadding=3><tr><td><IMG SRC=\""+img+"\" onClick=\"self.close();\" onMouseDown=\"self.close();\"> \n");
  myWin.document.write("</td></tr></table>")
  myWin.document.write("<font class=\"small\"><b>:::: <a href='window.close()' onClick='self.close()'><font color=black>CLOSE</font></a> ::::</b></font></center>")
  myWin.document.write("</HTML>")

}
function openTextWin(contentText,w,h){
  var day = new Date();
  var id = day.getTime();
  X = Math.ceil((W-w)/2);
  Y = Math.ceil((H-h)/2);
  var prop = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left ="+X+",top = "+Y;
  stringa="width="+w+",height="+h+",left="+X+",top="+Y;

  var myWin=window.open("", id, stringa);
  myWin.document.write("<HTML>")
  myWin.document.write("<TITLE>WWW.LCMUSIC.NET</TITLE>")
  myWin.document.write("<BODY BGCOLOR='#0c7c95'>")
  myWin.document.write("<b><FONT SIZE=2 COLOR=ffffff TYPE=\"arial\">");
  myWin.document.write(contentText);
  myWin.document.write("</b></FONT>");
  myWin.document.write("<CENTER><div class=\"hr\"></div><b><FONT SIZE=1 COLOR=ffffff TYPE=\"arial\">WWW.LCMUSIC.NET <br>");
  myWin.document.write("<br><a href='javascript:window.close()' onClick='self.close()' style=\"text-decoration:none;color:white\">::CLOSE::</a></b>")
  myWin.document.write("</FONT></CENTER>")
  myWin.document.write("</HTML>")

}

function switchColor(obj, pviiColor) { //v1.1 by Project VII
        obj.style.backgroundColor=pviiColor
}


function noright()
{
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")

}

//workIT() : input Multi-object-contents in the array.
function workIT(u,t,s,f){
 var cu=u;
 var ct=t;
 var cs=s;
 var cf=f;
 var idx=0;
 cu = black+slash+u+period+m+p+three;


 if(objMmInfo == null){ objMmInfo=new Array(); idx=0;}
 else{ idx=objMmInfo.length;}

 if(u=="" || u==null){cu="";}
 if(t=="" || t==null){ct="nontitle";}
 if(f=="f" || f=="F"){cf="f";}
 else{cf="t"; intSelMmCnt=intSelMmCnt+1;}


 if(blnUseSmi){ objMmInfo[idx]=new mkMmPath(cu,ct,cf,cs);}
 else{objMmInfo[idx]=new mkMmPath(cu,ct,cf);}

 intActMmCnt=intSelMmCnt;
 intMmCnt=objMmInfo.length;
}


function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {
if(document.layers||(document.getElementById&&!document.all)) 
{
if (e.which==2||e.which==3) {(message);return false;}
}
}

