function windowOpen( sURL, sName, iWidth, iHeight, iType) {
	if( iType == 0) {
		window.open( sURL, sName, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}

	if( iType == 1) {
		//without scrollbars
		window.open( sURL, sName, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	
	if( iType == 2) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=1,location=0,status=1,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 3) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=0,location=0,status=0,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 4) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=1,location=0,status=0,menubar=0,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 5) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=0,location=0,status=0,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	if( iType == 6) {
		//For brochure
		window.open( sURL, sName, 'resizable=1,toolbar=0,location=1,status=0,menubar=1,scrollbars=1,width=' + String( iWidth) + ',height=' + String( iHeight));
	}
	return false;
}

function getSelectedVesselsFromWholeList( sControlName ,sSelectedBefore ){
	var sSelectedOnThisPage = "";
	var bNeedComma = false;
	sSelectedBefore = "," + sSelectedBefore + ",";
	var el, i, objs = document.getElementsByTagName("input");
	for (i = objs.length; --i >= 0 && (el = objs[i]);){
		if (sSelectedBefore.length > 2){
			var regId =	new RegExp( "," + el.value + ",","g");  
			if (el.name == sControlName && el.checked ){
				if ( ! regId.test( sSelectedBefore ) ){
					sSelectedOnThisPage += "," + el.value;
				}
				bNeedComma = true;
			}
			if (el.name == sControlName && !el.checked ){
				sSelectedBefore = sSelectedBefore.replace( regId, "," );
			}
		}else{
			if (el.name == sControlName && el.checked )	sSelectedOnThisPage += "," + el.value;		
		}
	}
	sSelectedBefore = sSelectedBefore.substr(1,(sSelectedBefore.length-2));
	if (!bNeedComma ) sSelectedOnThisPage = sSelectedOnThisPage.substr(1);
	return sSelectedBefore + sSelectedOnThisPage 
}

window.focus();

