// TIMELESS TREASURES COLLECTIONS ARRAY
var coll_timeless=new Array();
	coll_timeless[0]="<p>Introducing <strong>Timeless Treasures</strong> by Judith Jack. Beautiful jewelry essentials perfect for any occasion. The collection includes perennial favorites that are classic and ideal for gift giving.</p>";
	coll_timeless[1]="<p>Introducing <strong>Signature Treasures</strong> by Judith Jack. Handcrafted in sterling silver and special cut marcasite, the collection captures the Judith Jack logo in a sophisticated style. Timeless elegance that is perfect day or night.</p>";

// NEW COLLECTIONS ARRAY	
var coll_new=new Array();
	coll_new[0]="<p>Introducing <strong>Enchanted Forest</strong> by Judith Jack. A stunning bold bangle features intricate design and fine milgrained accents. The entire collection evokes a feeling of vintage romance and chivalry.</p>";
	coll_new[1]="<p>Introducing <strong>Luxe Rings</strong> by Judith Jack. A bold collection of rings featuring sparkling semi-precious stones of Honeysuckle Quartz, Oregon Blue Quartz and Mosaic Pink Quartz. Rich luxury is interpreted using genuine marcasite, vibrant color and intricate design.</p>";
	coll_new[2]="<p>Introducing <strong>Spotlight</strong> by Judith Jack, the look is modern and contemporary. Cascading sterling silver chains are accented with special cut marcasite stones and clustered stations. The perfect accessory worn alone or in multiples.</p>";
	coll_new[3]="<p>Introducing <strong>Jungle Fever</strong> by Judith Jack.  Dramatic zebra patterns criss-cross a background of genuine Onyx.  Fine milgrain accents and dimensional designs create this trend right collection.</p>";
	coll_new[4]="<p>Introducing <strong>Signature Pearl</strong> by Judith Jack.  Modern signature logo designs are showcased with genuine Biwa pearl in dramatic and feminine styling.  Elegance that goes from day to evening.</p>";
	coll_new[5]="<p>Introducing <strong>Carnivale TwoTone</strong> by Judith Jack, sophisticated filigree is combined with 14K gold vermeil, sterling silver and special cut marcasite for a unique and dramatic look. Contemporary two-tone styling lends versatility to accessorizing any wardrobe.</p>";
	coll_new[6]="<p>Introducing <strong>Sherwood Forest</strong> by Judith Jack. The intricate details and romantic openwork designs are accentuated in heraldic silhouettes. A timeless elegant collection.</p>";

// MAIN COLLECTIONS PAGE CODE FOR DISPLAYING THE DIFFERENT COLLECTIONS
	function coll_viewer(c){
	var randomNums=Math.floor(Math.random()*(c.length));
	var mainPict=document.getElementById('main_pic_left');
	var mainText=document.getElementById('main_txt_left');
	var coll_setBloc=document.getElementById('collection_sets_bloc');
	var coll_txtBloc=document.getElementById('innerleft_txt_bloc');
	var colls=coll_setBloc.getElementsByTagName('img');
	var collslink=coll_setBloc.getElementsByTagName('a');
	var loc="images/collections/"
	    if(!coll_timeless){
		mainPict.src=loc+collslink[randomNums].getAttribute('title')+"_set.jpg";
		mainText.src=loc+collslink[randomNums].getAttribute('title')+"_set_txt.gif";
	 	//coll_txtBloc.innerHTML=c[randomNums];
	 	}
	 	
		for (var i=0; i<colls.length; i++){
			//Keeps New Collection Sets Links from working till their pages are ready
			if(document.getElementById('coll_new')){
				collslink[i].onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg";return false;};
				//collslink[i].onmouseover=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg";return false;};
				colls[i].onclick=function(){launcher(this.src.replace('ro.jpg','set_lg.jpg'));return false;};
				colls[i].onmouseover=function(){this.src=this.src.replace('.jpg','_ro.jpg'),this.style.cursor="default";};
				colls[i].onmouseout=function(){this.src=this.src.replace('_ro.jpg','.jpg');};
			}else{				
			collslink[i].onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg";};				
			//collslink[i].onmouseover=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg";return false;};
			colls[i].onmouseover=function(){this.src=this.src.replace('.jpg','_ro.jpg');};
			colls[i].onmouseout=function(){this.src=this.src.replace('_ro.jpg','.jpg');};
			}
			//Keeps Signature Set Link from working till that page is ready
			if(document.getElementById('coll_timeless')){
				if(document.getElementById('coll_sig_set') || document.getElementById('coll_luxe_set') || document.getElementById('coll_spot_set') || document.getElementById('coll_carn_set') ){
					document.getElementById('coll_sig_set_pict').onclick=function(){launcher(this.src.replace('ro.jpg','set_lg.jpg'));return false;};			
					document.getElementById('coll_sig_set').onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg",this.style.cursor="pointer";return false;};
					document.getElementById('coll_luxe_set_pict').onclick=function(){launcher(this.src.replace('ro.jpg','set_lg.jpg'));return false;};			
					document.getElementById('coll_luxe_set').onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg",this.style.cursor="pointer";return false;};
					document.getElementById('coll_spot_set_pict').onclick=function(){launcher(this.src.replace('ro.jpg','set_lg.jpg'));return false;};			
					document.getElementById('coll_spot_set').onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg",this.style.cursor="pointer";return false;};
					document.getElementById('coll_carn_set_pict').onclick=function(){launcher(this.src.replace('ro.jpg','set_lg.jpg'));return false;};			
					document.getElementById('coll_carn_set').onclick=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg",this.style.cursor="pointer";return false;};
					
					//document.getElementById('coll_sig_set').onmouseover=function(){mainText.src=loc+this.getAttribute('title')+"_set_txt.gif",mainPict.src=loc+this.getAttribute('title')+"_set.jpg",this.style.cursor="default";};
					//document.getElementById('coll_sig_set').onclick=function(){return false;};
				}
			}
		}
	}
// LAUNCHES POPUP WINDOW OF LARGER SET IMAGE	
function coll_viewer_lg() {
	var coll_set_lg=document.getElementById('main_pic_left');
	coll_set_lg.onclick=function(){launcher(this.src.replace('.jpg','_lg.jpg'));this.style.cursor="pointer";return false;};
	coll_set_lg.onmouseover=function(){this.style.cursor="pointer";};
}
// POPUP WINDOW OF LARGER COLLECTION IMAGE VIEW
function launcher(url) {
      	OpenWin=window.open( url, 'newwin', 'resizable=no,menubar=no,toolbar=no,location=no,status=no,scrollbars=no,width=525,height=425'); 
	OpenWin.focus();
}	
// INDIVIDUAL COLLECTIONS: TIMELESS TREASURES ARRAY	
var coll1=new Array();
	coll1[0]="<p>Star Pendant (Front)</p>";
	coll1[1]="<p>Star Pendant (Reverse)</p>";
	coll1[2]="<p>Square Pendant (Front)</p>";
	coll1[3]="<p>Square Pendant (Reverse)</p>";
	coll1[4]="<p>Nugget Pendant (Front)</p>";
	coll1[5]="<p>Nugget Pendant (Reverse)</p>";
	coll1[6]="<p>Oval Pendant (Front)</p>";
	coll1[7]="<p>oval Pendant (Reverse)</p>";

// INDIVIDUAL COLLECTIONS: SIGNATURE TREASURES ARRAY	
var coll2=new Array();

// INDIVIDUAL COLLECTIONS PAGE CODE FOR DISPLAYING JEWELRY
	function doit(){
	var mainPict=document.getElementById('main_pict');
	var thumbsBloc=document.getElementById('innerleft_ths_bloc');
	var thumbstxtBloc=document.getElementById('innerleft_txt_bloc');
	var thumbs=thumbsBloc.getElementsByTagName('img');
	var thumbslink=thumbsBloc.getElementsByTagName('a');
	var loc="images/collections/"
	var query=location.search.substring(1);
	var qresult=query.split('=');
	
		for (var i=0; i<thumbs.length; i++){
			//mainPict.setAttribute('title',thumbslink[0].getAttribute('href'));
			//thumbslink[i].onclick=function(){return false;};
			//thumbslink[i].onmouseover=function(){mainPict.src=this.getAttribute('href');return false;};
			//thumbslink[i].onmouseout=function(){thumbstxtBloc.innerHTML=coll1[mainPict.getAttribute('name')],mainPict.src=mainPict.getAttribute('title');return false;};
			//thumbs[i].onmouseover=function(){if(this.getAttribute('alt')=='1'){}else{this.src=this.src.replace('.jpg','o.jpg');};};
			//thumbs[i].onmouseout=function(){if(qresult[1]==(parseInt(this.getAttribute('name'))+(1))){}else{this.src=this.src.replace('o.jpg','.jpg');};};
			thumbs[i].onmouseover=function(){this.src=this.src.replace('.jpg','o.jpg');};
			thumbs[i].onmouseout=function(){this.src=this.src.replace('o.jpg','.jpg');};
		}
	}
// Provides room for more thumbnails by hiding and showing div tags	
	function viewmore(){
		var bloc6=document.getElementById('innerleft_ths_6');
		var bloc12=document.getElementById('innerleft_ths_12');
		var thumbs=bloc6.getElementsByTagName('img');
		bloc6.style.display="none";
		bloc12.style.display="block";
	}
	function viewless(){
		var bloc6=document.getElementById('innerleft_ths_6');
		var bloc12=document.getElementById('innerleft_ths_12');
		var thumbs=bloc6.getElementsByTagName('img');
		bloc6.style.display="block";
		bloc12.style.display="none;"
	}



// Provides functionality and animation for in collections navigation

var cp=(-75);
	function navMove(){
		var navbox=document.getElementById('innerright_nav_bloc');
		//navbox.onmouseover=function(){alert('hi');};
		navbox.onmouseover=function(){navbox.style.right=cp+(75);};
		//navbox.onmouseover=function(){navout();};
		navbox.onmouseout=function(){navbox.style.right=cp;};
		//navbox.onmouseout=function(){navin();};
	}
	function moveitout(){
  		if(cp>=(-75)||cp!=0){
			cp+=5;
			alert(cp);
			var pict=document.getElementById('innerright_nav_bloc');
			pict.style.right=cp+'px';
  		}else{
			clearInterval(loveit);
			alert('Stop Me');
  		}
	}
	function moveitback(){
  		if(cp>0){
			cp-=5;
			//alert(cp);
			var pict=document.getElementById('innerright_nav_bloc');
			pict.style.left=cp+'px';
  		}else{
			clearInterval(hateit);
			//alert('Stop Me');
  		}
	}
	function navout(){
		loveit=setInterval("moveitout()",20);
	}
	function navin(){
		hateit=setInterval("moveitback()",20);
	}

//IE 7.0 fixe for Flash Border
	function fixeflash(containerID) {
	var flashContainer = document.getElementById(containerID);
	var flashMovie = document.createElement("div");
	flashMovie.innerHTML = flashContainer.innerHTML.replace(/</g, "<").replace(/>/g, ">");
	flashContainer.parentNode.insertBefore(flashMovie, flashContainer);
	flashContainer.parentNode.removeChild(flashContainer);
	flashMovie.setAttribute("id",containerID);
	}


// Auto Loads Scripts to Page
	window.onload=function() {
		if(document.getElementById('collection_solo')){
			doit();
			//navMove();
		}
		if(document.getElementById('navbar')){
			fixeflash("navbar");
			fixeflash("footer");
			if(document.getElementById('flash_bloc')){
				fixeflash("flash_bloc");
			}
		}
		if(document.getElementById('coll_timeless') || document.getElementById('coll_new')){
			if(document.getElementById('coll_timeless')){
				coll_viewer(coll_timeless);
				coll_viewer_lg();
			}else {
				coll_viewer(coll_new);
				coll_viewer_lg();
			}				
		}
	}

