/*CSS Browser Selector v0.4.0 (Nov 02, 2010)*/
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
/****************/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/****************/
function toggler(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}
/****************/
function ShowHide(LayerName,TotalLayers){//v1.0
	var temp = new Array();
	temp = LayerName.split('_');
	ReLayerName = temp[0];
	
		for (i=1;i<=TotalLayers;i++){
		document.getElementById(ReLayerName+'_'+i).style.display = 'none';
		}
	document.getElementById(LayerName).style.display = 'block';
}
/****************/
function LinkClasses(IDlink,TotalLinks,OFF,ON){//v1.0
	var temp = new Array();
	temp = IDlink.split('_');
	ReIDlink = temp[0];

		for (i=1;i<=TotalLinks;i++){
		document.getElementById(ReIDlink+'_'+i).className = OFF;
		}
	document.getElementById(IDlink).className = ON;
}
/****************/
/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
/********ANTI IE6 BUG***********/
if (document.all && !window.opera && !window.XMLHttpRequest) {
	document.execCommand("BackgroundImageCache",false,true);
}
/*****jQUERY*****/
function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
/*SKYPE*/
$(document).ready(function() {
		window.setTimeout(function() {
			$('.skype_pnh_container').html('');
			$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
		}, 800);
	});

/****W3C HIDDEN STYLES****/
document.write('<style type="text/css">');
document.write('HTML {overflow:-moz-scrollbars-vertical}');
document.write('TEXTAREA {resize: none}');
//document.write('.PngFix {behavior: url("css/iepngfix.htc");}');
document.write('</style>');

if (menu == 'serviciosdelshopping') {
    $('document').ready(function(){
        $('#Servicios LI A').hover(
            function() {
                var panel = '#' + $(this).attr('rel');
                $('#Layers .Data').hide();
                $(panel).show();
                $('#Servicios LI A').removeClass('Active');
                $(this).addClass('Active');
            },
            function() {}
        );
    })
}

if (menu == 'carrusel') {
    $('document').ready(function(){
        $('#Boxes').jcarousel({            
            scroll: 1,
            buttonNextHTML: '<a id="Next" href="javascript:;"></a>',
            buttonPrevHTML: '<a id="Back" href="javascript:;"></a>',
            wrap: 'circular'
        });
    })
}
            



function popup2 ( content ) {
    $('#Popup iframe').attr('src','../unicenter/layouts/'+content+'.html');
    $('#Mask2').css({
      width: function(){ return $(document).width(); },
      height: function(){ return $(document).height(); },
      opacity: 0.9
    });
    $('#Popup').css({
      left: function(){ return $(window).width() / 2 - 338; },
      top: function(){ return $(window).height() / 2 - 225; }
    });
    $('#Popup').fadeIn();
    $('#Mask2').fadeIn();
}

function closePopUp2() {
    $('#Popup').fadeOut();
    $('#Mask2').fadeOut();
}


function popup() {    
    var domain = top.location.hostname;
    var pathName = '';
    if(domain=='localhost'){       
        pathName = 'http://'+domain+'/cencosud/trunk/movies/getMoviesSite.xml?project=unicenter';
    }else if(domain=='php'){
       // pathName = 'http://190.137.153.138:3388/cencosud/movies/getMoviesSite.xml?project=unicenter';
        pathName = 'http://190.228.129.179//movies/getMoviesSite.xml?project=unicenter';
    }else {        
        //pathName = 'http://190.137.153.138:3388/cencosud/movies/getMoviesSite.xml?project=unicenter';
        pathName = 'http://190.228.129.179//movies/getMoviesSite.xml?project=unicenter';
    }   
       
                         
    var params = {wmode:'transparent'};
    var flashvars = {path:pathName};
    var attributes = {};
    swfobject.embedSWF("../unicenter/files/swf/cineshoyts.swf", "flash", "1024", "768", "9.0.0","expressInstall.swf",flashvars, params, attributes);
    //swfobject.embedSWF("../plazaoeste/files/swfs/cineshoyts.swf", "flash", "971", "535", "9.0.0","expressInstall.swf",params, params, params);
   // swfobject.embedSWF("../unicenter/files/banners/banner_hoyts_hoyts.swf", "id_banner1", "312", "117", "9.0.0", false, flashvars, params, attributes);
    
    $('#Mask').css({
      width: function(){ return $(document).width(); },
      height: function(){ return $(document).height(); },
      opacity: 0.9
    });
    $('#HoytsFlash').css({
      left: function(){ return $(window).width() / 2 - 485; },
      top: function(){ return $(window).height() / 2 - 317; }
    });
    $('#HoytsFlash').fadeIn();
    $('#Mask').fadeIn();
}

function closePopUp() {
    $('#HoytsFlash').fadeOut();
    $('#Mask').fadeOut();
}

function popup_intrusivo() {
    var flashvars = {};
    var domain = top.location.hostname;
    var pathName = '';
      
    var params = {wmode:'transparent',path:pathName};
    var attributes = {};
    swfobject.embedSWF("../unicenter/files/banners/intrusivo/intrusivo_otonoinvierno.swf", "flashintrusivo", "625", "765", "9.0.0","expressInstall.swf",params, params, params);
    $('#Mask').css({
      width: function(){ return $(document).width(); },
      height: function(){ return $(document).height(); },
      opacity: 0.8
    });
  	$('#Intrusivo').css({'left' : '50%', 'margin-left' : '-312px'});


    $('#Intrusivo').fadeIn();
    $('#Mask').fadeIn();
}


function popup_servicios_shopping(){
    $('#Popup iframe').attr('src','../unicenter/templates/locales_adheridos.html');
    $('#Mask2').css({
      width: '920px',
      height: '668px',
      opacity: 0.9
    });
    $('#Popup').css({
      left: function(){ return $(window).width() / 2 - 338; },
      top: function(){ return $(window).height() / 2 - 225; }
    });
    $('#Popup').fadeIn();
    $('#Mask2').fadeIn();
}


function closePopUp_intrusivo() {
    $('#Intrusivo').fadeOut();
    $('#Mask').fadeOut();
}

$('document').ready(function(){
    $('#NavTop #Btn2').live('click', function() {
        popup2('contacto');
    })
    $('#NavTop #Btn1').live('click', function() {
        popup2('newsletter');
    })
    $('#Mask2').live('click', function() {
        closePopUp2();
    })
    
    $('#Popup .close').live('click', function() {
        closePopUp2();
    })

    $('#FlashLnk').live('click', function(){
        popup();
    })

	
    $('#Mask').live('click', function(){ closePopUp(); })
    $('#HoytsFlash A').live('click', function(){ closePopUp(); })
	
	$('#verlocalesadheridos').live('click', function(){
        popup_servicios_shopping();
    })

})

function contactLinkHome(){
	window.location.href="../../pages/index.html";
}

/* qtips */
$(document).ready(function()
{
   // Match all <A/> links with a title tag and use it as the content (default).
   $('a[title]').qtip();
});



