// -------------------- +^+ -------------------- //
//                Sitekore 2.6.1                 //
//          JAVASCRIPT WINDOW FUNCTIONS          //
// --------------------------------------------- //
//          (c) 2002-2007 Mad Dog Studios.       //
//             http://www.sitekore.com/          //
// -------------------- +^+ -------------------- //

/* Legacy support for help windows in the backend */
function open_window_help(mypage) {
	if (screen.width) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	} else {
		winl = 0;
		wint =0;
	}

	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	
	var nofeatures = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0";
	var myname = 'Help';
	var h = '400';
	var w = '300';
	
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += nofeatures;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}
/* /Legacy support for help windows in the backend */

/* Popup window function */
function popwin(mypage,myname,w,h,features) {
	if (screen.width) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	} else {
		winl = 0;
		wint =0;
	}

	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	
    var params = "";
    var nofeatures = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0";
    var basicfeatures = "scrollbars=1,resizable=1,menubar=0,location=1";
    var morefeatures = "toolbar=1,location=1,directories=1,status=1,copyhistory=1";
	
    switch (features){
        case "none":
            params += nofeatures;
        break;
        case "basic":
            params += basicfeatures;
        break;
        case "full":
            params += basicfeatures + "," + morefeatures;
        break;
        default:
            params += features;
		break;
    }

	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += params;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}
/* /Popup window function */

/* Variable name popup window in Sitekore Settings */
function var_name_display(variable_name) {
	temp = prompt("Variable name:",variable_name);
}
/* /Variable name popup window in Sitekore Settings */

/* Load specified URL on page */
function loadurl(url) {
	window.location.href = url;
}
/* /Load specified URL on page */

/* /Load specified URL on opening page (for use in popup windows) */
function otherwindow(url)
{
	window.opener.location.href=url;
	window.close();
}
/* /Load specified URL on opening page (for use in popup windows) */