/*if (window.location.href.split('#')[1]){ urlpostA = window.location.href.split("#")[1]; window.location = ""+urlpostA; }*/ var isfullscreen = false; var isWin = (navigator.userAgent.indexOf('Win') != -1); var isWinXP = (navigator.userAgent.indexOf('Windows NT 5.1') != -1); var isIE = (navigator.userAgent.indexOf('MSIE') != -1); var isNS = (navigator.userAgent.indexOf('Mozilla') != -1) && (navigator.userAgent.indexOf('Firefox') == -1); var isFirefox = (navigator.userAgent.indexOf('Firefox') != -1); var isMAC = (navigator.platform.indexOf('Mac') != -1); var version = parseInt(navigator.appVersion); var previousXPosition = 0; var previousYPosition = 0; var previousWidth = 0; var previousHeight = 0; function openFullscreen(url,newwindow,reload, titlebar) { reload = (typeof reload=="undefined") ? true : reload; if(isIE) { previousXPosition = top.window.screenLeft; previousYPosition = top.window.screenTop; previousWidth = document.body.clientWidth; previousHeight = document.body.clientHeight; } else if(self.outerWidth) { previousXPosition = self.screenX; previousYPosition = self.screenY; previousWidth = self.outerWidth; previousHeight = self.outerHeight; } else { previousXPosition = top.window.screenLeft; previousYPosition = top.window.screenTop; previousWidth = document.body.clientWidth; previousHeight = document.body.clientHeight; } if(isWin && isIE) { top.window.resizeTo(screen.width/2,screen.height/2); top.window.moveTo(0,0); var wleftdiff = top.window.screenLeft; var wrightdiff = (screen.width/2) - top.window.document.body.clientWidth - wleftdiff; var htopdiff = top.window.screenTop; var hbottomdiff = (screen.height/2) - top.window.document.body.clientHeight - htopdiff; var newXPosition = -wleftdiff; var newYPosition = -htopdiff; var newWidth = screen.width+wleftdiff+wrightdiff; var newHeight = screen.height+htopdiff+hbottomdiff; if((newWidth>screen.width) && (newHeight>screen.height)) { previousXPosition -= wleftdiff; previousYPosition -= htopdiff; previousWidth += wleftdiff+wrightdiff; previousHeight += htopdiff+hbottomdiff; } top.window.resizeTo(previousWidth,previousHeight); top.window.moveTo(previousXPosition,previousYPosition); parameters = "x="+previousXPosition+"&y="+previousYPosition+"&width="+previousWidth+"&height="+previousHeight; if(isWinXP || newwindow) { url = (url.indexOf('?') != -1) ? url+"&"+parameters : url+"?"+parameters; if(!titlebar) { arg = 'fullscreen=yes' } else { deltaWidth = -8; deltaHeight = -30; newWidth = screen.width + deltaWidth; newHeight = screen.height + deltaHeight; arg = 'width='+newWidth+',height='+newHeight+',left=0,top=0,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0' } window.open(url,'chanelfullscreen', arg); if(!newwindow) { top.window.opener = top; top.window.close(); } } else { top.window.moveTo(newXPosition-2,newYPosition-2); top.window.resizeTo(newWidth,newHeight); if(reload) { top.location.href = (url.indexOf('?') != -1) ? url+"&"+parameters : url+"?"+parameters; } } } else { deltaWidth = (isNS) ? ((isMAC) ? -10 : -5) : ((isMAC) ? -5 : 0); deltaHeight = (isNS) ? ((isMAC) ? -50 : -50) : ((isMAC) ? -2 : -30); deltaLeft = (isNS) ? ((isMAC) ? -6 : -6) : ((isMAC) ? -5 : -5); deltaTop = (isNS) ? ((isMAC) ? -30 : -30) : ((isMAC) ? -10 : -30); newWidth = screen.width + deltaWidth; newHeight = screen.height + deltaHeight; parameters = "x="+previousXPosition+"&y="+previousYPosition+"&width="+previousWidth+"&height="+previousHeight; url = (url.indexOf('?') != -1) ? url+"&"+parameters : url+"?"+parameters; newwin = window.open(url,'chanelfullscreen', 'width='+newWidth+',height='+newHeight+',left=0,top=0,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0'); newwin.resizeTo(newWidth,newHeight); newwin.moveTo(0,0); if(!newwindow) { top.window.opener = top; top.window.close(); } } } function openwin(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) { mytop=Math.floor((screen.height/2) - (myheight/2)); myleft=Math.floor((screen.width/2) - (mywidth/2)); debute =window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu) } function ShowPopupLegal(strLegalURL){ openwin(strLegalURL,'legal',600,700,0,0,0,1,0,0); } function Showpopup() { openwin('http://www.chanel.com/register/en-us/register.php','USRegistration',800,380,0,0,0,1,0,0); } var fullscreen = true; var justSized =false; var settedheight = 0; function getRealHeight(){ if (navigator.userAgent.indexOf('MSIE')>0){ return document.body.clientHeight; }else { return window.innerHeight; } } function getRealWidth(){ if (navigator.userAgent.indexOf('MSIE')>0){ return document.body.clientWidth; }else { return window.innerWidth; } } function setHeight(pHeight) { if (navigator.userAgent.indexOf('Firefox')>-1 && navigator.userAgent.indexOf('Mac')>-1 ) { var FFHeight = ((pHeight*100)/getRealHeight()); var newHeight = new String(FFHeight+"%"); var newWidthSmall = "100%"; var newHeightSmall = "650px"; } else { var newHeight = new String(pHeight+"px"); var newWidthSmall = "1000px"; var newHeightSmall = "650px"; } if(ckeckIfSmallRes()){ so.element.style.width = newWidthSmall; so.element.style.height = newHeightSmall; }else{ so.element.style.width = newWidthSmall; so.element.style.height = newHeight; } settedheight = pHeight; fullscreen = false; return so.attributes.height; } function setFullHeight() { if(ckeckIfSmallRes()){ so.element.style.width = '1000px'; so.element.style.height = '650px'; }else{ so.element.style.width = '100%'; so.element.style.height = '100%'; } fullscreen = true; return so.attributes.height; } function setPosition(pPos){ window.scrollTo(0,pPos); } function ckeckIfSmallRes(){ //alert(getRealHeight()); //return (document.body.clientWidth<1024 || document.body.clientHeight<200); return (getRealHeight()<610 || getRealWidth()<1000); } function smallRes() { var smallRes = ckeckIfSmallRes(); if (smallRes){ if (getRealWidth()<1000){ so.element.style.width = '1024px'; }else{ so.element.style.width = '100%'; } //if (getRealHeight()<610){ so.element.style.height = '650px'; /*}else{ so.element.style.height = '100%'; }*/ }else { if (fullscreen){ setFullHeight(); }else{ setHeight(settedheight) ; } } return smallRes; } function resizeFlash (){ //CATHC BUG ON IE 6 //alert("resize"); //if(navigator.userAgent.indexOf("MSIE 6") == -1){ smallRes(); //} else{ //} } window.onresize = resizeFlash; window.onload= resizeFlash;