/*
 * NETPORT v1.0
 * Created on Jun 24, 2006
 * Author: Dorin SIRBU
 * E-mail: dorin.sirbu@ist.ro
 * 
 * This software is copyrighted. Under the copyright laws, this software
 * may not be copied, in whole or in part, without prior written consent
 * of INDUSTRIAL SOFTWARE TECHOLOGIES SRL or its assignees. This software
 * is provided under the terms of a license between INDUSTRIAL SOFTWARE
 * TECHOLOGIES SRL and the recipient, and its use is subject to the terms
 * of that license.                  										
 * 
 * TRADEMARKS: INDUSTRIAL SOFTWARE TECHNOLOGIES and INDUSTRIAL SOFTWARE   
 * TECHNOLOGIES NETPORT are registered trademarks of INDUSTRIAL SOFTWARE  
 * TECHNOLOGIES SRL, in the European Community and are trademarks of      
 * INDUSTRIAL SOFTWARE TECHNOLOGIES SRL, in other countries. The          
 * INDUSTRIAL SOFTWARE TECHNOLOGIES logo, is a trademark of
 * INDUSTRIAL SOFTWARE TECHNOLOGIES SRL, in the Europenian Community and
 * other countries. 	
 * 
 * (c)2003-2006 INDUSTRIAL SOFTWARE TECHNOLOGIES SRL
 * http://www.ist.ro
 * 
 */ 
// Enable/Select a selector option.
function enable_select_option(selector, value)
{
	var n = selector.options.length;
	for(i = 0; i < n ; i ++)
	{
		// Checking if required value.
		if(selector.options[i].value == value)	{
			selector.options[i] = new Option(selector.options[i].text, value, true, true);
		}
	}
}

function open_div(id, center) {
	if(document.getElementById) {
		div = document.getElementById(id);
		if(center) {
			left = (document.body.clientWidth - div.offsetWidth) / 2;
			if(left < 0) left = 0;	
			div.style.left = left;	
		}
		div.style.visibility = 'visible';
	}	
}
function close_div(id) {
	if(document.getElementById) {
		div = document.getElementById(id);
		div.style.visibility = 'hidden';
	}
}

function redirc(form, urls) 
{
    if (form.country.options.selectedIndex != selCountryIndex) {
        var url = urls[form.country.options.selectedIndex];
        location.href = url;
    }
}

function redirToUrl(selector) {
	if(selector.selectedIndex != -1) {
		window.location = selector.options[selector.selectedIndex].value;
	}
}

function nsAlert(msg) {
	  Dialog.alert(msg, {className: "alphacube",  width:250, okLabel: "OK"})  	
		// new Window({url: "window_key_url_content.html", className: "alphacube" }).show()
		// WindowCloseKey.init();
    	// Windows.closeAllModalWindows();
}
  
function nsAsk(msg) {
	  return Dialog.confirm(msg, {className: "alphacube",  width:250, okLabel: "OK"})
}

function umsg(id, m) {
	$(id).innerHTML = m;
	if(document.getElementById) new Effect.Pulsate(document.getElementById(id));
}
