// artist photo effects 

function high(which2){

    theobject=which2;

    highlighting=setInterval("highlightit(theobject)",50);

    borderit(which2,"black");

}

function low(which2){

    clearInterval(highlighting)



    var object = which2.style;

    object.opacity = 0.6;  

    object.MozOpacity = 0.6;

    object.KhtmlOpacity = 0.6;

    if (which2.filters) object.filter = "alpha(opacity=60)";

    borderit(which2,"white");

}

function borderit(which,color){

    //if IE 4+ or NS 6+

    if (document.all||document.getElementById){

        which.style.borderColor=color

    }

}

function highlightit(cur2){

        

        var object = cur2.style;

        object.opacity = 0.9;  

        object.MozOpacity = 0.9;

        object.KhtmlOpacity = 0.9;

        if (cur2.filters) object.filter = "alpha(opacity=" + (cur2.filters.alpha.opacity+20) + ")";

        if (window.highlighting) clearInterval(highlighting);

}



var isMac  = (navigator.platform.toLowerCase().indexOf('mac') != -1)



function wl(t) {

GE('logger').innerHTML = GE('logger').innerHTML + "<br>"+ t;

}

function hr(){

    wl("<hr>")

}

function fnImgEff(oL){



    if(typeof(oL)=="string") oL = document.getElementById(oL)



    if(oL){



        if(isVisible1(1,oL)){

     

               if(oL.filters && !isMac)  if(oL.filters[0])  oL.filters[0].Apply();

              // if(isParentVisible(oL,1)) fnShowHideL(oL,'visible')

              // if(isVisible1(1,oL)) fnShowHideL(oL,'visible')

	           if(oL.filters && !isMac)  if(oL.filters[0]) oL.filters[0].Play();

	    }

	    else{

            sID = oL.id

            if(!(sID)) oL.id = generateID()	;

	        setTimeout('fnImgEff('+oL.id+')', 200)

	        

	        }

	}	

	

	

}

function fnShowHideL(oL,sProp){

	if(typeof(oL) =='string') oL = document.getElementById(oL)

	if(oL.style) oL.style.visibility=sProp;

}

/////////////////////////////////////////////

     function isVisible1(deep,oL) {

        var vis = YAHOO.util.Dom.getStyle(oL, 'visibility') != 'hidden' 

               && YAHOO.util.Dom.getStyle(oL, 'display') != 'none';

        if(!deep || !vis){

            return vis;

        }

        var p = oL.parentNode;

        while(p && p.tagName.toLowerCase() != 'body'){

            if(YAHOO.util.Dom.getStyle(p, 'visibility') == 'hidden' || YAHOO.util.Dom.getStyle(p, 'display') == 'none'){

                return false;

            }

            p = p.parentNode;

        }

        return true;

    }

/////////////////////////////////////////////



//-------------------------------

function PlayFadeEff(sFID){

        shiftOpacity(sFID, 1000)

}



//change the opacity for different browsers

function changeOpacity(opacity, id) {

    if (document.getElementById(id)){

        var object = document.getElementById(id).style;

        object.opacity = (opacity / 101);  // delete to 101 and not to 100 for avoiding the flicker (when fading in) at the end

        object.MozOpacity = (opacity / 101);

        object.KhtmlOpacity = (opacity / 101);

        object.filter = "alpha(opacity=" + opacity + ")";

    }

} 



function shiftOpacity(id, millisec) { 

    //if an element is invisible, make it visible, else make it ivisible 

        changeOpacity(0, id);

        FadeImage(id, 0, 100, millisec); 

} 



var arFadeTO = new Array();

function FadeImage(id, opacStart, opacEnd, millisec) {

    //speed for each frame

    var speed = Math.round(millisec / 100);

    var timer = 0; 

    var i;

    for(i = opacStart; i <= opacEnd; i++)

        {

        setTimeout("changeOpacity(" + i + ",'" + id + "')",(timer * speed));

        timer++;

    }

   

}

function generateID(){

        dt=new Date;

        sID = "fa"+(dt.getMonth() + 1)+"_"+dt.getDate()+"_"+dt.getYear()+"_"+dt.getHours()+"_"+dt.getMinutes()+"_"+dt.getSeconds()

        s = Math.random().toString();

        s = s.substr(2);

        sID += "_"+ s +'_id';

    

     return sID

}



function ef1(o){

    sID = o.id 

    if(!(sID)) o.id = generateID()

    PlayFadeEff(sID)

    

}

