function openProduct()
{
    setHtml("desktops/swf/micrositio.swf", "722px", "468");
	popup(true, 120, 189, 722, 468);
}
function openMedia(id,type){
    var swf = "desktops/swf/gallery" + (type == "images" ? "Images" : "Video") + ".swf";
	var alto = (type == "images" ? 429 : 318 );
    setHtml(swf, "502px", alto, "pathXML=desktops/xml/galleries/producto_" + id + ".xml");
	popup(true, 140, 300, 502, alto);
}
function setHtml(swf, w, h, p1)
{
    var html = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='" + w + "' height='" + h + "'>";
	html += "<param name='quality' value='high'>";
    html += "<param name='bgcolor' value='#000000'>";
    html += "<param name='scale' value='noscale'>";
    html += "<param name='movie' value='" + swf + "'>";
    
    if(p1 != undefined)
        html += "<param name='flashVars' value='" + p1 + "'>";
    
    html += "<embed src='" + swf + "' scale='noscale' quality='high' bgcolor='#000000'  pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'" + (p1 != undefined ? " flashvars='" + p1 + "'" : "" ) + " width='" + w + "' height='" + h + "'></embed>";
	html += "</object>";
	document.getElementById("div_win").innerHTML = html;
}

var posT = 0;

function popup(st, t, l, we, he)
{
    var b = document.getElementById('div_bg');
    b.style.visibility = st ? 'visible' : 'hidden';
    
    if(navigator.appVersion.indexOf('MSIE') != -1)
        b.style.height = '1392px';
    
    var w = document.getElementById('div_win');
    w.style.visibility = st ? 'visible' : 'hidden';
    
    if(!st){ w.style.top = '1400px';w.innerHTML = ''; }
    
    posT = 0;
    if(t != undefined){
        var _top = (parseInt(document.documentElement.clientHeight)/2)-(he/2);
        
        if(navigator.appVersion.indexOf('MSIE') != -1 && getIEVersion() < 7){
	        
    	    var topPosFix = typeof window.pageYOffset != 'undefined' ?
			    window.pageYOffset:document.documentElement &&
			    document.documentElement.scrollTop ?
			    document.documentElement.scrollTop: document.body.scrollTop?
			    document.body.scrollTop:0;	    
			w.style.top = (topPosFix + _top) + 'px';			
			posT = _top;
	    } else {
            w.style.top = _top + 'px';
	    }
	}
    
    if(l != undefined){
        var _left = (parseInt(document.documentElement.clientWidth)/2)-(we/2);
        w.style.left = _left + 'px';
    }
}

function getIEVersion()
{
    var version = 0;
    if (navigator.appVersion.indexOf("MSIE") != -1)
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
    return version;
}

function openDemo(str,w,h){
	window.open(str,'demos','width='+w+',height='+h);
}

document.write("<div id='div_win' align='right' style='z-index: 99; visibility: hidden; width: 0px; height:0px; position: " + (navigator.appVersion.indexOf('MSIE') != -1 && getIEVersion() < 7 ? 'absolute' : 'fixed') + "; left: 300px; top: 140px;'></div>");
window.onscroll = on_scroll;

function on_scroll()
{
    if(navigator.appVersion.indexOf('MSIE') != -1 && getIEVersion() < 7)
    {
        var w = document.getElementById('div_win');
        if(t != undefined)
        {
	        var topPosFix = typeof window.pageYOffset != 'undefined' ?
		        window.pageYOffset:document.documentElement &&
		        document.documentElement.scrollTop ?
		        document.documentElement.scrollTop: document.body.scrollTop?
		        document.body.scrollTop:0;
    	    
		        w.style.top = (topPosFix + posT) + 'px';
	    }
    }
}