﻿// JScript File



/* 1. קוד ליצירת אפקט של פייד בעצמים 
קוד לדף משתמש 
<img  onmouseover="slowhigh(this)" class="gradualshine" onmouseout="slowlow(this)" src="Images/play.GIF" />
***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=65

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}


/* 2. קוד ליצירת צל לאובייקט 
קוד משתמש - 
<img src="dynamiclogo4.gif" class="shadowcss" effect="popshadow" mousedowncolor="white" mouseupcolor="gray">

class="shadowcss"  == Contains the name of the CSS class that initially sets the image to be relatively positioned and offset to the left and top, with the "shadow" filter applied to it. 
effect="popshadow" == Do not modify. 
mousedowncolor=?   == Specify the color of the shadow when the image is depressed (color name or its hex value). Should match the color of your page's background if you wish to create the illusion of the shadow disappearing. 
mouseupcolor=?     == Specify the color of the shadow when the image is not depressed. In other words, the color of the shadow. 

**********************************************
* Pop-it Image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

function updownshadow(){
if (event.srcElement.effect=="popshadow"){
shadowobj=event.srcElement
if (event.type=="mousedown"){
shadowobj.filters[0].color=shadowobj.mousedowncolor
shadowobj.style.left=shadowobj.style.top=0
}
else if (event.type=="mouseout" && event.fromElement.effect=="popshadow" || event.type=="mouseup"){
shadowobj.filters[0].color=shadowobj.mouseupcolor
shadowobj.style.left=shadowobj.style.top=shadowobj.filters[0].OffX*(-1)
}
}
}

if (document.attachEvent){
document.attachEvent("onmousedown", updownshadow)
document.attachEvent("onmouseup", updownshadow)
document.attachEvent("onmouseout", updownshadow)
}





