function ThickboxController(){
this.show = function(element){
return false;
}
this.hide = function(){
hideBox();
return false;
}
this.showImage = function(href){
ceateBox();
ThickboxOverlay.show();
ThickboxLoader.show();
ThickboxWrapper.css({marginLeft: '-10000px',width:1500}).show();
imgPreloader = new Image();
imgPreloader.onload = function(){
imgPreloader.onload = null;
var de = document.documentElement;
var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
var x = w - 150;
var y = h - 150;
var imageWidth = imgPreloader.width;
var imageHeight = imgPreloader.height;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
}
} else if (imageHeight > y) {
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
if (imageWidth > x) {
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
}
}
ThickboxBody.width(imageWidth);
var imgobj = ThickboxBody.html('');
if(jQuery.browser.msie){
imgobj.css({paddingBottom: '16px'});
}
rezise();
};
imgPreloader.src = href;
return false;
}
this.showIframe = function(href){
ceateBox();
ThickboxOverlay.show();
ThickboxLoader.show();
ThickboxWrapper.css({marginLeft: '-10000px',width:1500}).show();
ThickboxBody.html('');
return false;
}
this.iframeParty = function(width,height){
if(($(window).height())-150 > height){
jQuery('#tx_ddiframe_pi1-iframe',ThickboxBody).height(height+(isIE6 === true ? 50 : 4));
jQuery('#tx_ddiframe_pi1-iframe',ThickboxBody).width(width+7);
ThickboxBody.width(width);
}else{
jQuery('#tx_ddiframe_pi1-iframe',ThickboxBody).height($(window).height()-150);
jQuery('#tx_ddiframe_pi1-iframe',ThickboxBody).width(width+57);
ThickboxBody.width(width+50);
}
rezise();
return false;
}
/**
* private vars
*/
var ThickboxOverlay = false;
var ThickboxWrapper = false;
var ThickboxBody = false;
var ThickboxLoader = false;
var IE_frame = false;
var isIE6 = (jQuery.browser.version.substr(0,3)=="6.0" && jQuery.browser.msie);
var isIE = jQuery.browser.msie;
/**
* private methods
*/
function rezise(){
ThickboxWrapper.css({marginLeft: '-' + parseInt((ThickboxBody.outerWidth({ margin: true }) / 2)+38) + 'px'}).width(ThickboxBody.width()+76);
if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
ThickboxWrapper.css({marginTop: '-' + parseInt((ThickboxBody.outerHeight({ margin: true }) / 2),10) + 'px'});
}
}
function ceateBox(){
if(isIE6){
jQuery("body","html").css({height: "100%", width: "100%"});
jQuery("html").css("overflow","hidden");
if(IE_frame === false){
IE_frame = jQuery('').appendTo("body");
}
IE_frame.show();
}
if(ThickboxLoader === false){
ThickboxLoader = jQuery('