function commonPopup(url, width, height, toolsInd, wname)
{
    var options = "width=" + width + ",height=" + height + ",top=" + ((screen.height - height) / 4).toString() + ",left=" + ((screen.width - width) / 2).toString();

    switch (toolsInd)
    {
        case 1:
            options += ",toolbar=no,status=no,resizable=no,scrollbars=yes";
            break;
        case 2:
            options += ",menubar=yes,toolbar=yes,status=yes,resizable=yes,location=yes,scrollbars=yes";
            break;
        case 3:
            options += ",top=50,left=50,resizable=yes,scrollbars=yes,status=no,menubar=no,toolbar=no,location=yes";
            break;
        case 4:
            options += ",top=50,left=50,resizable=yes,scrollbars=no,status=no,menubar=no,toolbar=no,location=yes";
            break;            
        default:
            //do nothing
            break;
    }

    if (!wname)
    {
        wname = "Popup";
    }

    popupWindow = window.open(url, wname, options);

    if (popupWindow)
    {
        popupWindow.focus();
    }
}


function lefturner(id,mode,size) {
	turn = size;
	max = 600;
	if(mode == 'right') {
		if($(id).getStyle('right') == 'auto') {
			$(id).setStyle('right', '150px');
		} else {
			wi = parseInt($(id).getStyle('right'));
			
			if((wi+turn) < max)
				$(id).setStyle('right', (wi+turn)+'px')
		}
	}
	
	if(mode == 'left') {
		if($(id).getStyle('right') != 'auto') {
			wi = parseInt($(id).getStyle('right'));
			
			if((wi-turn) > -1)
				$(id).setStyle('right', (wi-turn)+'px')
		}
	}
}
