function new_window(){var myobjBody=document.getElementsByTagName("body").item(0);var ArrayPageSize=GetPageSize();myobjBody.style.zIndex="1";var bodyHeight=500;var myOverlay=document.createElement("div");myOverlay.setAttribute('id','myoverlay');var arrayPageSize=getSize();myOverlay.style.width="100%";myOverlay.style.height=ArrayPageSize[1]+'px';myOverlay.style.position="absolute";myOverlay.style.zIndex="105";myOverlay.style.top="0";myOverlay.style.left="0";myOverlay.style.backgroundColor="#85BBEF";myOverlay.style.opacity=7/10;myOverlay.style.filter='alpha(opacity='+7*10+')';myOverlay.style.display="none";myobjBody.appendChild(myOverlay);var myLightbox=document.createElement("div");myLightbox.setAttribute('id','myLightbox');myLightbox.style.width="100%";myLightbox.style.position="absolute";myLightbox.style.top="0";myLightbox.style.left="0";myLightbox.style.zIndex="120";myLightbox.style.display="none";myobjBody.appendChild(myLightbox);var iframeWrap=document.createElement("div");iframeWrap.setAttribute('id','iframewrap');var height=(document.getElementById('new_window_main_height')==null)?"478px":document.getElementById('new_window_main_height').value;iframeWrap.style.height=height;iframeWrap.style.width="720px";iframeWrap.style.position="relative";iframeWrap.style.margin="40px auto";iframeWrap.style.padding="10px";iframeWrap.style.backgroundColor="#fff";myLightbox.appendChild(iframeWrap);var closeBut=document.createElement("img");closeBut.setAttribute('src','/new-images/close2.gif');closeBut.setAttribute('style','float:right');closeBut.style.cursor="pointer";closeBut.onclick=function(){document.getElementById('myoverlay').style.display='none';document.getElementById('myLightbox').style.display='none';document.getElementById('myFrame').setAttribute('src','');}
iframeWrap.appendChild(closeBut);var myFrame=document.createElement("iframe");myFrame.frameborder="0";myFrame.setAttribute('style','margin-top: 10px;border: none');myFrame.setAttribute('id','myFrame');myFrame.setAttribute('width','100%');var frame_height=(document.getElementById('new_window_iframe_height')==null)?'450':document.getElementById('new_window_iframe_height').value;myFrame.setAttribute('height',frame_height);myFrame.setAttribute('scrolling','auto');myFrame.setAttribute('frameborder','0');iframeWrap.appendChild(myFrame);elements=document.getElementsByTagName('a');if(elements){if(elements.length){for(i=0;i<elements.length;i++){linkOj=elements[i];set_new_window_function(linkOj,"720px",frame_height);}}else{linkOj=elements;set_new_window_function(linkOj,"720px",frame_height);}}}
function new_window_custom(src,iframe_width_,new_window_main_height_){iframe_width=typeof(iframe_width_)=='undefined'?"720px":iframe_width_;var myobjBody=document.getElementsByTagName("body").item(0);var ArrayPageSize=GetPageSize();myobjBody.style.zIndex="1";var bodyHeight=500;var myOverlay=document.createElement("div");myOverlay.setAttribute('id','myoverlay');var arrayPageSize=getSize();myOverlay.style.width="100%";myOverlay.style.height=ArrayPageSize[1]+'px';myOverlay.style.position="absolute";myOverlay.style.zIndex="105";myOverlay.style.top="0";myOverlay.style.left="0";myOverlay.style.backgroundColor="#85BBEF";myOverlay.style.opacity=7/10;myOverlay.style.filter='alpha(opacity='+7*10+')';myOverlay.style.display="none";myobjBody.appendChild(myOverlay);var myLightbox=document.createElement("div");myLightbox.setAttribute('id','myLightbox');myLightbox.style.width="100%";myLightbox.style.position="absolute";myLightbox.style.top="0";myLightbox.style.left="0";myLightbox.style.zIndex="120";myLightbox.style.display="none";myobjBody.appendChild(myLightbox);var iframeWrap=document.createElement("div");iframeWrap.setAttribute('id','iframewrap');iframeWrap.style.position="relative";iframeWrap.style.margin="40px auto";iframeWrap.style.padding="10px";iframeWrap.style.backgroundColor="#fff";myLightbox.appendChild(iframeWrap);var closeBut=document.createElement("img");closeBut.setAttribute('src','/new-images/close2.gif');closeBut.setAttribute('style','float:right');closeBut.style.cursor="pointer";closeBut.onclick=function(){document.getElementById('myoverlay').style.display='none';document.getElementById('myLightbox').style.display='none';document.getElementById('myFrame').setAttribute('src','');}
iframeWrap.appendChild(closeBut);var myFrame=document.createElement("iframe");myFrame.frameborder="0";myFrame.setAttribute('style','margin-top: 10px;border: none');myFrame.setAttribute('id','myFrame');myFrame.setAttribute('width','100%');myFrame.setAttribute('scrolling','auto');myFrame.setAttribute('frameborder','0');iframeWrap.appendChild(myFrame);iframe_height=typeof(new_window_main_height_)=='undefined'?"478px":new_window_main_height_;document.getElementById('myFrame').setAttribute('src',src);document.getElementById('myFrame').style.height=iframe_height;document.getElementById('iframewrap').style.width=iframe_width;document.getElementById('myoverlay').style.display="block";document.getElementById('myLightbox').style.display="block";document.getElementById('myFrame').style.height=typeof(new_window_main_height_)=='undefined'?document.getElementById('iframewrap').offsetHeight+'px':new_window_main_height_;document.getElementById('iframewrap').style.height=typeof(new_window_main_height_)=='undefined'?document.getElementById('iframewrap').offsetHeight+'px':new_window_main_height_;window.scroll(0,0);}
function set_new_window_function(linkObj){if(linkObj.className.indexOf('new_window')>=0){linkOj.onclick=function(){anchor=this.href;if(anchor){new_window_custom(anchor);window.scroll(0,0);return false;}}}}
function GetPageSize(){var xScroll,yScroll;var windowWidth,windowHeight;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
dyWindowArrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return dyWindowArrayPageSize;}
function getSize(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
var out=Array();out[0]=myWidth;out[1]=myHeight;return out;}
function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent("on"+evType,fn);return r;}}
addEvent(window,'load',new_window);
