function popup_window(winFile, winHost, winWidth, winHeight, winTitle) 
{
	var LeftPosition = (screen.width) ? (screen.width-winWidth)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-winHeight)/2 : 0;
	var w = window.open('', '','width='+winWidth+',height='+winHeight+',resizable=no,top='+TopPosition+',left='+LeftPosition+'');
	var d = w.document;
	d.open();
	d.writeln("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "+"\"http://www.w3.org/TR/html4/strict.dtd\">");
	d.writeln("<html><head><title>" +winTitle+ "<\/title>");
	d.writeln("<meta http-equiv=\"Content-Script-Type\" ","content=\"text/javascript\"><\/head>");
	d.writeln("<body style='margin:0px;padding:0px;'>")
	d.writeln("<div><img src='"+winHost+"/phpThumb/phpThumb.php?src="+winFile+"&w="+winWidth+"&f=png&far=B&q=100'><\/div>");
	d.writeln("<\/body><\/html>");
	d.close();
}

function getCookie(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 setCookie (name, value, days) {
	var expireDate = new Date();
	var expstring = expireDate.setDate(expireDate.getDate()+parseInt(days));
	document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}
//----------------------------------------------------------

function deleteCookie(name) {
	setCookie(name,"",-1);
}
function init_dw_Scroll() {
    var wndo = new dw_scrollObj('wn', 'lyr1');
    wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
    // id, autohide (hide when not needed), axis
    wndo.setUpScrollControls('scrollbar', true, 'v');
    
    // Links to swap content 
    wndo.setUpLoadLinks('extra_controls');
    // Demonstrating jump to top and scroll to ID controls 
    wndo.setUpScrollControls('extra_controls');

    // Demonstrating how you can include a jump to top link inside the scroll area 
    wndo.setUpScrollControls('wn');
    
}

// if necessary objects exists link in the style sheet and call the init function onload
if ( dw_scrollObj.isSupported() ) {
    dw_writeStyleSheet(host+'/stylesheets/extras_demo.css');
    dw_Event.add( window, 'load', init_dw_Scroll);
}