//  pass the url  and  optionally a width, height, and window name
function spawnWindow(url,name,w,h){
	if(w == undefined) w = 320;
	if(h == undefined) h = 240;
	if(name == undefined) name = "popWindow";
	var newWindow = window.open(url,name,"toolbar=0,scrollbars=1,resizable=1,width="+w+",height="+h+"\"");		
 }
 function spawnJukebox(){
	var newWindow = window.open("content/jukebox.php",'jb',"toolbar=0,scrollbars=1,resizable=1,width=300,height=250");		
 }
 function ifExists(val, htmlOut, other){
	if (typeof other=='undefined') other = "";
	
	if (val.length && val != "false" && val !="/echotools/images/spacer.gif"){
	document.write (htmlOut);
	}else{
		if(other.length)
		{
			document.write (other);
		}
	}
}
function ifTrack(upload,emek){
	if (upload.length)
	{
		document.write ('<div class="inline-audio"><a href="http://www.adobe.com/products/flashplayer/" id="audioplayer_'+emek+'">Download FLASH to listen.</a></div>');
		AudioPlayer.embed("audioplayer_"+emek, {  
			soundFile: upload,  
			transparentpagebg: "yes",
			bg: "000000",
			leftbg: "2e094b",
			lefticon: "e6329f",
			voltrack: "000000",
			volslider: "e6329f",
			rightbg: "2e094b",
			rightbghover: "fed441",
			righticon: "e6329f",
			righticonhover: "2e094b",
			loader: "57c6f2",
			track: "4a4181",
			tracker: "57c6f2",
			border: "2e094b",
			text: "000000"
		});
	};
}
$(document).ready(function(){
	stripeMyStuff ("#tourContainer" , "div" , "alt");
	stripeMyStuff ("#tourContainer" , "tr" , "alt");
	// adds stuff to the stepList
	$('.stepList li').each(function(i){
		i = i + 1;
		$(this).prepend('<span class="stepnumber">'+i+'.</span>');
	})
	
// UGC VIDEO CONTEST VOTE BUTTON FIX
	var voteLinkHref = $('a.favoriteLink').attr('href');
	if(voteLinkHref == '~ugcFavoriteLink~') {
		var loginLink = $('div#videoContestCommentsContainer a').attr('href');
		//alert(loginLink);
		$('a.favoriteLink').attr('href', loginLink);
		$('a.favoriteLink span').text('Login to vote');
	};
	
// HOME SIDEBAR YOUTUBE CAROUSEL
	if($('body').attr('id')=='home'){
		$('div#youtube_vid').carousel();
	//	$('div.carousel-wrap').css({'height' : '226px', 'width' : '280px', 'overflow-x' : 'hidden'});
		$('div.carousel-wrap').attr( { style:"height:226px; width:280px; overflow-x:hidden; position:relative;"});
	}
	
	$('table.comContainer').attr({width:"100%"});
});