// JavaScript Document

Cufon.replace('h1'); // Works without a selector engine
//Cufon.replace('#date');
//Cufon.replace('.title_bar'); // Requires a selector engine for IE 6-7, see above 
jQuery.noConflict();


function showElement(target){
	$(target).set('tween', {
        duration: 700,
        transition: Fx.Transitions.Expo.easeOut // This could have been also 'bounce:out'
    }).tween('opacity', '1');
}
function hideElement(target){
	$(target).set('tween', {}).tween('opacity', '0');
}


function weatherBGsel(status){
	//document.getElementById('weather').style.backgroundImage = 'url(/assets/weathers/backgrounds/weather-bg-'+status+'.png)';
	if (status == 'Snowy'){
		var NewScript=document.createElement('script')
		NewScript.src="/js/snowstorm.js"
		document.body.appendChild(NewScript);
	}

}

/*
window.addEvent('domready', function(){
	// Second Example
	// The same as before: adding events
	$('desc_box').addEvents({
 	   mouseenter: function(){
      // Always sets the duration of the tween to 1000 ms and a bouncing transition
      // And then tweens the height of the element
      $('desc_box').set('tween', {
        duration: 1000,
        transition: Fx.Transitions.Expo.easeOut // This could have been also 'bounce:out'
      }).tween('width', '262px');
    },
    mouseleave: function(){
      // Resets the tween and changes the element back to its original size
      $('desc_box').set('tween', {}).tween('width', '0px');
    }
  });

});
*/


function shiftElement(target){
	$(target).set('tween', {
        duration: 300,
        transition: Fx.Transitions.Expo.easeOut // This could have been also 'bounce:out'
    }).tween('margin-left', '-2');
}
function unshiftElement(target){
	$(target).set('tween', {}).tween('margin-left', '0');
}

function livecamShift(target, nameValue){
	var con = document.getElementById("cam");
	con.innerHTML = '<img src="http://www.mtbuller.com.au/snowcam/img_'+target+'.jpg?="'+Math.random()*777+' width="320" height="213" />';
	var name = document.getElementById("cam_name");
	name.innerHTML = nameValue;
	
	closeMenu('cam_dropdown');
}
