var HolokoteModalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		try {
			$('#homepageRotation').cycle('resume');
		} catch(err){}
		
		$(".HolokoteModal-window").remove();
		$(".HolokoteModal-overlay").remove();
		if ($.browser.msie) {
			$('select').show();
		}
		$("#theSLSpinnerDiv").remove();
	},
	open:function()
	{
		try {
			$('#homepageRotation').cycle('pause');
			if ($.browser.msie) {	scroll(0,0); }
		} catch(err){}
		
		var HolokoteModal = "";
		HolokoteModal += "<div class=\"HolokoteModal-overlay\"></div>";
		HolokoteModal += "<div id=\"" + this.windowId + "\" class=\"HolokoteModal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
		HolokoteModal += this.content;
		HolokoteModal += "</div>";	
		
		var theSLSpinner = "";
		theSLSpinner += "<div id=\"theSLSpinnerDiv\"><img src=\"/System-Selector/img/largebusy.gif\" width=\"143\" height=\"143\" /></div>";
		$(this.parent).append(theSLSpinner);
		
		
		if ($.browser.msie) {
			$('select').hide();
		}

		$(this.parent).append(HolokoteModal);
		
		$(".HolokoteModal-window").append("<a class=\"HolokoteClose-window\">Close</a>");
		$(".HolokoteClose-window").click(function(){HolokoteModalWindow.close();});
		$(".HolokoteModal-overlay").click(function(){HolokoteModalWindow.close();});
	}
};


var openMyHolokoteModal = function(source, width, height)
{
	randnum = Math.random();
  HolokoteModalWindow.windowId = "myHolokoteModal";
  HolokoteModalWindow.width = width;
  HolokoteModalWindow.height = height;
  HolokoteModalWindow.content = "<iframe id='"+ randnum +"' width='"+ HolokoteModalWindow.width +"' height='"+ HolokoteModalWindow.height +"' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
  HolokoteModalWindow.open();
};

