


function getParameter(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;*/
	
	
	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 openPopup(_url, _width, _height, _scroll){
	var width = parseInt(_width, 10);
	var height = parseInt(_height, 10);
	
	if(_width == null) width = 800;
	if(_height == null) height = 600;
	
	openWindow(_url, 'cacique', width, height, null, null, _scroll);
}


function openWindow(url, name, w, h, x, y, _scroll){
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	
	var wW = (w!=null) ? w : screenWidth-50;
	var wH = (h!=null) ? h : screenHeight-150;
		
	var wX = (x!=null) ? x : Math.round(screenWidth/2-(wW/2));
	var wY = (y!=null) ? y : Math.round(screenHeight/2-(wH/2));
    
    var name = (name != null) ? name : 'dyPopup';
    
    var scrollbar = (_scroll != null) ? _scroll : 0;
	
    var win = window.open(url, name, 'resizable=0,scrollbars=1,status=0,location=0,toolbar=0,menubar=0,width='+wW+',height='+wH+',screenX='+wX+',screenY='+wY+',left='+wX+',top='+wY+'');

    return win;
}
*/


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 + '');
}


