
var interval;
startPosition=0;
topPosition=150;
endPosition=250;
speed=50;
var obj = null;
browserName = navigator.appName;



function scrollit()
{

if (startPosition!=450)
	{
	startPosition=startPosition+1
	topPosition=topPosition-1
	document.getElementById('display').style.clip="rect(" + (startPosition + 1) + " 150 " + (startPosition + endPosition) + " 0)"
	document.getElementById('display').style.top=topPosition
	interval=setTimeout("scrollit()",speed)
	}
else
	{
	startPosition=0
	topPosition=150
	endPosition=250
	interval=setTimeout("scrollit()",speed)
	}
}

function stopinterval()
{
clearTimeout(interval)
}


function changeURLLink(Link){
//alert(Link);
//alert(Object);
document.all.iframeFAQ.src=Link;
}


function changeImgOn(currentLink, image){
if(document.all&&!window.opera) {
currentLink.filters.blendTrans.apply(); 
currentLink.filters.blendTrans.play();
}
currentLink.src=image; 
}

function getImageBlown(val){
//alert(dynimages[val]);
return dynimages[val][0] + "blown.jpg";

}

function lite(obj) {
if(document.all&&!window.opera) {
obj.filters.blendTrans.apply(); 
obj.filters.blendTrans.play(); 
} 
} 


function getImage(val){
//alert(dynimages[val]);
return dynimages[val][0] + "small.jpg";

}

function turnOn(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="black";
}

function turnOnHeadWhite(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="black";
}

function turnOff(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="gray";
}

function turnOnHead(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="black";
}

function turnOffWhite(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="#4477bb";
}

function turnOffBlue(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="#4477bb";
}

function turnOffGray(currentLink){
//currentLink.filters.blendTrans.apply(); 
//currentLink.filters.blendTrans.play();
currentLink.style.color="gray";
}

function showLayer(layerid){


layer = document.getElementById(layerid);

v = layer.style.visibility;

document.getElementById('NECKLACES').style.visibility = "hidden";
document.getElementById('EARRINGS').style.visibility = "hidden";
document.getElementById('ANKLETS').style.visibility = "hidden";
document.getElementById('BRACELETS').style.visibility = "hidden";

//alert(v)
if(v=="hidden"){
layer.style.visibility = "visible";
}
else
{
layer.style.visibility = "hidden";
}
}

function hideLayer(layerid){
layer = document.getElementById(layerid);
layer.style.visibility = "hidden";
}

function showCaption(obj,img){


	obj = document.getElementById(obj);
//alert(browserName);
	//obj=eval("document."+ obj);
	if(browserName  == "Microsoft Internet Explorer"){

		obj.style.filter="blendTrans(duration=.6)";
		
		obj.filters.blendTrans.Apply();
		obj.style.visibility="visible";
		obj.filters.blendTrans.Play();
		obj.innerHTML=img;
	}
	else{
		obj.innerHTML=img;

	}
	
}

function hideCaption(obj){
	obj = document.getElementById(obj);

	//if(document.all && opera_spoofing_ie){
		obj.style.filter="blendTrans(duration=.6)";
		obj.filters.blendTrans.Apply();
		obj.style.visibility="hidden";
		obj.filters.blendTrans.Play();
	//}
	obj.src="/images/clr.gif"
}

function highLightLetter(obj){
	
obj.style.color="white";
	//obj.innerHTML="white";
}

function remHighLightLetter(obj){
	obj.style.color="gray";
	//obj.innerHTML="black";
}

function highLight(obj){
	

	obj.style.borderColor="white";
}

function remHighLight(obj){
	
	obj.style.borderColor="black";
}


function getObj(name) 
{ 
        if (document.getElementById) 
        { 
                return document.getElementById(name).style; 
        } 
        else if (document.all) 
        { 
                return document.all[name].style; 
        } 
        else if (document.layers) 
        { 
                return MM_findObj(name); 
        } 
}


function rightHighLight(obj){
	
	obj.src="images/arrow_right_highlighted.gif";	
	turnOn(document.getElementById("Next"));
}

function leftHighLight(obj){
	
	obj.src="images/arrow_left_highlighted.gif";
	turnOn(document.getElementById("Previous"));
}

function rightUnHighLight(obj){
	
	obj.src="images/arrow_right.gif";
	turnOffGray(document.getElementById("Next"));
}

function leftUnHighLight(obj){
	
	obj.src="images/arrow_left.gif";
	turnOffGray(document.getElementById("Previous"));
}


function rightHighLightWhite(obj){
	
	obj.src="images/arrow_right_highlightedWhite.gif";	
	turnOnHead(document.getElementById("Next"));
}

function leftHighLightWhite(obj){
	
	obj.src="images/arrow_left_highlightedWhite.gif";
	turnOnHead(document.getElementById("Previous"));
}

function rightUnHighLightWhite(obj){
	
	obj.src="images/arrow_rightWhite.gif";
	turnOff(document.getElementById("Next"));
}

function leftUnHighLightWhite(obj){
	
	obj.src="images/arrow_leftWhite.gif";
	turnOff(document.getElementById("Previous"));
}


function ClickImg(obj){

	var img = "images/"+obj.id + "1.jpg";
	mainImage.src = img;
}

//Preload images ("yes" or "no"):
var preloadimg="no"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0
var styleSize="width=450px;height=314px"


//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){
alert(dynimages.length);
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<div href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'.jpg" border="'+imgborderwidth+'" style="'+styleSize+'" width=450 height=314>'
if (theimg[1]!="")
imghtml+='</div>'
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
document.getElementById('Reference').innerHTML= dynimages[imgindex][0]
document.getElementById('ReferenceID').innerHTML= dynimages[imgindex][1] 
document.getElementById('ProdDesc').innerHTML= dynimages[imgindex][2]
document.getElementById('ProdDim').innerHTML= dynimages[imgindex][3]  
var imgobj=document.getElementById(loadarea)
//alert(imgobj)
//if (imgobj.filters && window.createPopup){
//imgobj.style.filter=filterstring
//imgobj.filters[0].Apply()
//}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
//alert(returnimgcode(dynimages[imgindex]))

//if (imgobj.filters && window.createPopup)
//imgobj.filters[0].Play()

return false
}
}

function modifyimage1(loadarea, imgindex){
if (document.getElementById){
document.getElementById('Reference').innerHTML= dynimages[imgindex][0]
document.getElementById('standardWhite').innerHTML= dynimages[imgindex][1] 
var imgobj=document.getElementById(loadarea)
//alert(imgobj)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
//alert(returnimgcode(dynimages[imgindex]))

if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()

return false
}
}

/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* Last updated Mar 15th, 04'. Added "End of Gallery" message.
* This copyright notice must stay intact for legal use
***********************************************/

var restarea=655 //1) width of the "neutral" area in the center of the gallery in px
var maxspeed=5 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var endofgallerymsg="<span style='font-size: 11px'>End of Gallery</span>" //3) message to show at end of gallery. Enter "" to disable message.

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
var actualHeight=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var scrollspeed=0
var movestate=""

if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-10000;"></span>')

var actualwidth=''
var cross_scroll, ns_scroll
var loadedyes=0

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}

function positiondiv(){
menuheight=parseInt(crossmain.offsetHeight)
mainobjoffsetH=getposOffset(crossmain, "top")
statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px"
statusdiv.style.top=menuheight+mainobjoffsetH+"px"
}

function showhidediv(what){
if (endofgallerymsg!="")
statusdiv.style.visibility=what
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function moveleft(){
if (loadedyes){
movestate="left"
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
lefttime=setTimeout("moveleft()",10)
}

function moveright(){
if (loadedyes){
movestate="right"
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
righttime=setTimeout("moveright()",10)
}

function motionengine(e){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var curposy=window.event? event.clientX : e.clientX? e.clientX: ""
curposy-=mainobjoffset-dsocx
var leftbound=(menuwidth-restarea)/2
var rightbound=(menuwidth+restarea)/2
if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restarea)/2) * maxspeed
if (window.righttime) clearTimeout(righttime)
if (movestate!="left") moveleft()
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed
if (window.lefttime) clearTimeout(lefttime)
if (movestate!="right") moveright()
}
else
scrollspeed=0
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
movestate=""
}
}

function popUp1(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=none,scrollbars=none,location=none,statusbar=none,menubar=none,resizable=0,width=550,height=550,left = 262,top = 34');");
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer
menuwidth=parseInt(crossmain.style.width)
mainobjoffset=getposOffset(crossmain, "left")
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery
document.getElementById("temp").innerHTML=cross_scroll.innerHTML //NEW stuff
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
if (!window.opera) document.getElementById("temp").style.display="none"

crossmain.onmousemove=function(e){
motionengine(e)
}

crossmain.onmouseout=function(e){
stopmotion(e)
showhidediv("hidden")
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv()
positiondiv()
}
}
//window.onload=fillup
