function init_dw_Scroll() {
	var wndo = new dw_scrollObj('wn', 'lyr1', 't1');
    wndo.setUpScrollControls('scrollLinks');
	
     // code for hiding scroll arrows
    wndo.on_scroll = wndo.on_glidescroll = function () {
        // set id's to match your doc's (id attached to link surrounding image)
       var el = document.getElementById('right_aro');
        if (wndo.x == -wndo.maxX) {
            el.style.visibility = 'hidden';
        } else {
            el.style.visibility = 'visible';
        }
	  // id for left arrow
        el = document.getElementById('left_aro');
        if (wndo.x == 0) {
            el.style.visibility = 'hidden';
        } else {
            el.style.visibility = 'visible';
        }
    }
    wndo.on_scroll(); // invoke immediately
	
}

// if code supported, link in the style sheet and call the init function onload
if (typeof(dw_scrollObj) != "undefined") {
	if ( dw_scrollObj.isSupported() ) {
		//dw_Util.writeStyleSheet('css/scroll.css');
		dw_Event.add( window, 'load', init_dw_Scroll);
	}
}
   
function fnOpenLink(objSelect) {
	if (objSelect.options[objSelect.selectedIndex].className == 'in_new_window') {
		window.open(objSelect.value);
	} else {
		window.location.href=objSelect.value;	
	}
}
   
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0; i < ca.length; i++) {
			var c = ca[i];
			while (c.charAt(0)===' ') {c = c.substring(1,c.length);}
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
	return null;
}

function eraseCookie(name) {
		createCookie(name,"",-1);
}

// Google Analytics code	
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-13225056-1']);
_gaq.push(['_trackPageview']);
(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
