popupWin = null;
function openPopUp(urlPop, properties, title)
{
	NFW = window.open("", 'DnbPopUp' , properties)     
    NFW.blur()
    window.focus()       
    var frameString=""+
					"<html>"+
					"<head>"+
					"<title>"+title+"</title>"+
					"</head>"+
					"<body topmargin='0' leftmargin='0' rightmargin='0' marginwidth='0' marginheight='0' framespacing='0'>"+
					"<div><img src='"+urlPop+"' border='0'></div>"+
					"</body></html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
    NFW.focus()

}

function imagePopup(urlPop, title, width, height) {
	var window_params = '';
	
	var oConfig = {
		
		'x' 		: -1,
		'y' 		: -1,
		//'width' 	: width + 20,
		'width' 	: 620,
		'height' 	: 600,
		'nodups'	: true,
		'scroll'	: false,
		'status'	: false,
		'location'	: false,
		'menubar'	: false,
		'toolbar'	: false,
		'hotkeys'	: false,
		'fullscreen': false,
		'resize'	: false,
		'name'	: "dialog",
		'url'		: ''
		
	}

	if( oConfig.x < 0 ) {
		oConfig.x = Math.round( ( screen.height - oConfig.height ) / 2 );
	}
	
	if( oConfig.y < 0 ) {
		oConfig.y = Math.round( ( screen.width - oConfig.width ) / 2 );
	}
	
	window_params = 
		
		'top=' + oConfig.x + ',' +
		'left=' + oConfig.y + ',' +
		'width=' + oConfig.width + ',' +
		'height=' + oConfig.height + ',' +
		'location=' + boolToYesNo( oConfig.location ) + ',' +
		'menubar=' + boolToYesNo( oConfig.menubar ) + ',' +
		'toolbar=' + boolToYesNo( oConfig.toolbar ) + ',' +
		'hotkeys=' + boolToYesNo( oConfig.hotkeys ) + ',' +
		'fullscreen=' + boolToYesNo( oConfig.fullscreen ) + ',' +
		'resizable=' + boolToYesNo( oConfig.resize ) + ',' +
		'status=' + boolToYesNo( oConfig.status ) + ',' +
		'scrollbars=' + boolToYesNo( oConfig.scroll );
	
	GALWIN = window.open(urlPop, 'GalleryPopUp' , window_params)     
  GALWIN.focus()
}

function boolToYesNo( value ) {
	return( value ? 'yes' : 'no' );
}

function WindowPopUp(fname, properties)
	{
		if( popupWin && !popupWin.closed )
		{
			popupWin.focus();
		}
		else
		{
			popupWin = window.open(fname, 'PopUp', properties);
		}
	}

function dl(txt) {
   return confirm(txt);
}

function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
  else if (object.className == 'Row1') object.className = 'RowOver1';
  else if (object.className == 'Row2') object.className = 'RowOver2';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
  else if (object.className == 'RowOver1') object.className = 'Row1';
  else if (object.className == 'RowOver2') object.className = 'Row2';
}

function FocusMsg(targ, msg) {
	targ.value = msg;
	return true;
}

function BlurMsg(targ, msg) {
	if (targ.value == '') targ.value = msg;
	return true;
}

function resizeImageWindow(wnd) {
	try {
	   wnd.height = wnd.document.getElementById("dispImg").height + 20;
	} catch(e) {
	
	}
}

function submitMobileSubscription()
{
	var mob_sub_url = 'mail.php?';
	
	var post_number = 0;
	var mobile = document.getElementById('id_mobile_subscribe_phone').value;
	var name = document.getElementById('id_mobile_subscribe_name').value;
	var city = document.getElementById('id_mobile_subscribe_city').value;
	
	var nr_validation = /^6[0-9]{7}$/i;
	var mymatch = nr_validation.exec(mobile);
	
	if(mymatch == null)
	{
		post_number++;
		document.getElementById('cellphone_td').style.border="1px red solid";
	}
	else 
	{
		document.getElementById('cellphone_td').style.border="0px";
	}
	
	
	if(document.getElementById('id_mobile_subscribe_city').value == '0')
	{
		post_number++;
		document.getElementById('city_td').style.border="1px red solid";
	}
	else 
	{
		document.getElementById('city_td').style.border="0px";
	}
	
	if(document.getElementById('id_mobile_subscribe_name').value == '' || document.getElementById('id_mobile_subscribe_name').value == 'Tavo vardas')
	{
		post_number++;
		document.getElementById('name_td').style.border="1px red solid";
	}
	else 
	{
		document.getElementById('name_td').style.border="0px";
	}
	
	
	if(post_number == 0)
	{
		mob_sub_url += 'mobile='+mobile+'&name='+name+'&city='+city;
		mob_sub_url = mob_sub_url;
		window.open(mob_sub_url, "mail","height=150,width=220,status=yes,toolbar=no,menubar=no,location=no"); 			
	}
	
	return false;
}