
function openWindow(url, w , h, x, y){
 	
	var default_w = 400;
	var default_h = 500;
	
	var screen_w = screen.width;
	var screen_h = screen.height;
	
	var wW = (w != null) ? w : default_w;
	var wH = (h != null) ? h : default_h;
	
	var wX = (x != null) ? x : Math.round(screen_w / 2 - (wW / 2));
	var wY = (y != null) ? y : Math.round(screen_h / 2 - (wH / 2));
	
	popup = window.open(url, 'caciquemojitomoreno', 'resizable=0,scrollbars=yes,status=0,location=0,toolbar=0,menubar=0,width=' + wW + ',height=' + wH + ',screenX=' + wX + ',screenY=' + wY + ',left=' + wX + ',top=' + wY + '');
}

function openMail(_url) {
	//location.href = 'mailto:' + _url + ';'; 
	location.href = 'mailto:' + _url;
}

function openURL(_url){
	window.open(_url);	
}

function getParam(name){
	
    var loc = location.search;
    var pos = loc.indexOf(name);
	
    if (pos < 0) 
		return null;
	
    var len = pos+name.length+1;
    var param = loc.substring(len);
	
    if (param.indexOf('&') > 0)
		param = param.substring(0, param.indexOf('&'));
    
	return param;
	
}



function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}


function gup2( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name;
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return false;
  else
    return true;
}





