

function WC(url) {
var title="FALLONE";
var id=1;
var x=600;
var y=270;
wf(id,title,url,x,y);
// window.open(url,'wc','width='+x+',height='+y+',top='+(screen.height-y)/2+',left='+(screen.width-x)/2+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
}
function W1(url) {
var title="FALLONE";
var id=1;
var x=600;
var y=270;
wf(id,title,url,x,y);
// window.open(url,'w1','width='+x+',height='+y+',top='+(screen.height-y)/2+',left='+(screen.width-x)/2+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
}
function W2(url) {
var title="FALLONE";
var id=1;
var x=600;
var y=450;
wf(id,title,url,x,y);
// window.open(url,'w2','width='+x+',height='+y+',top='+(screen.height-y)/2+',left='+(screen.width-x)/2+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
}
function W3(url) {
x=1;y=1;
window.open(url,'w3','width='+x+',height='+y+',top='+(screen.height-y)/2+',left='+(screen.width-x)/2+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
}

//-----------------------------------------------------------------------------
var reload=false;

function wf(id,title,url,x,y){
var border = "10";
var HeightTitleBar = "30";
var WidthWin = $(window).width();
var HeightWin = $(window).height();
x=String(x);
y=String(y);
if(x.match(/^[0-9]{1,3}(%)$/)) { x = x.replace(/[^0-9]+/,""); var X = (x*WidthWin)/100; } else if(x.match("^[0-9]{1,3}$")){ var X = x.replace(/[^0-9]+/,""); } else{ var X = WidthWin/2; }
if(y.match(/^[0-9]{1,3}(%)$/)) { y = y.replace(/[^0-9]+/,""); var Y = (y*HeightWin)/100; } else if(y.match("^[0-9]{1,3}$")){ var Y = y.replace(/[^0-9]+/,""); } else{ var Y = HeightWin/2; }
var xContainer = X-(border*2);
var yContainer = Y-(border*2);
var xData = X-(border*2);
var yData = yContainer-HeightTitleBar;
var content = "<div id='simplemodal-titlebar' style='height: " + HeightTitleBar + "px; line-height: " + HeightTitleBar + "px;'>" + title + "</div><iframe src='" + url + "' width='" + xData + "' height='" + yData + "' frameborder='0'>";
var buttonclose = "<button  type='button' id='simplemodal-buttonclose'>CERRAR</button>";
var butetonclose = "<div id='simplemodal-buttonclose'>CERRAR X</div>";
$.modal(content, {
closeHTML: buttonclose,
opacity: 40,
containerCss: { borderWidth: border + "px", width: xContainer + "px", height: yContainer + "px" },
dataCss: { border:"0px", width: xData + "px", height: yData + "px" },
onClose: function (dialog) { if(reload) { location.reload(); } else { dialog.data.hide(); dialog.container.hide(); dialog.overlay.hide(); $.modal.close(); } }
});
}



function ventana(id) {
$.modal("&nbsp;", {
close: true,
opacity: 50,
onShow: function (dialog) { $("#simplemodal-data").load("include/modulos/noticias_ventana.php?id="+id); }
});
}


