/********************************************************************
* Pro-Links Lightbox http://www.pro-links.com
*********************************************************************
* Author: 			Pro-Links Marketing and Web Services
* Version:			1.0
* Last Modified: 	6/17/2009
* Requirements: 	JQuery
* Description: 		Custom Lightbox, this code is sole property of Pro-Links
*					Development and may not be used, distributed, or copied
* 					without written consent from Pro-LInks Development LLC.
* Change Log:		-
*********************************************************************/


	function PLZLightbox(iframeUrl, heading){
		this.pgMaskId = "plzLightboxLargerPicPgMask";
		this.picContId = "plzLightboxLargerPic";
		this.closeWindowId = "plzLightboxLargerPicCloseWind";
		
		this.html = "<div id=\"" + this.pgMaskId + "\" onclick=\"return !(plzLightboxHide());\"></div>" + 
					"<div id=\"" + this.picContId + "\" onclick=\"return !(plzLightboxHide());\">" +
						"<div id=\"" + this.closeWindowId + "\">Close Window</div><h3>" + heading + "</h3>" +
						"<iframe src=\"" + iframeUrl + "\" height=\"100%\" width=\"100%\"></iframe>" +
					"</div>";
		
		
	}
	
	PLZLightbox.prototype.draw = function(){

		$("body").append(this.html);
		$("#" + this.picContId).css({
			"position" 			: "absolute",
			"z-index" 			: "9999",
			"display" 			: "none",
			"background-color" 	: "#FFFFFF",
			"padding" 			: "5px",
			"height"			: "700px",
			"width"				: "1050px",
			"top" 				: "40px",
			"left" 				: "40px",
			"cursor"			: "pointer"
		});
		$("#" + this.picContId + " iframe").css({
			"cursor"			: "default"										
		});
		$("#" + this.pgMaskId).css({
			"position" 			: "absolute",
			"background-color" 	: "#000000",
			"display" 			: "none",
			"z-index" 			: "9998",
			"top" 				: "0px",
			"left" 				: "0px",
			"cursor"			: "pointer"				
		});
		
		$("#" + this.closeWindowId).css({
			"position" 			: "relative",
			"float"				: "right", 
			"color" 			: "#1e2639",
			"font-weight" 		: "bold",
			"cursor"			: "pointer"
		});
	}
	

		
	
	function plzLightboxToggle(op){
		
		var id = "#plzLightboxLargerPic";
		var mid = "#plzLightboxLargerPicPgMask";
		switch(op){
			case 1:
				//$(id + " img").attr("src",imgUrl);
				var winH = $(window).height();   
        		var winW = $(window).width();  
				/*Load and run mask*/
				var maskHeight = $(document).height();   
        		var maskWidth = $(window).width();

				/*
				if($(id).height() > 500){
					$(id).height(520);
					$(id + " img").height(500);
				}else if($(id).width() > 600){
					$(id).width(600);
					$(id + " img").width(600);
				}
				*/
				
				var ts = $(document).scrollTop();

				$(mid).css({"width":maskWidth,"height":maskHeight});
				$(id).css("top",  (winH/2-$(id).height()/2) + ts);   
        		$(id).css("left", winW/2-$(id).width()/2); 
				
				$(id).fadeIn("default",function(){
					
				});
				 $(mid).fadeIn("default");
					$(mid).fadeTo("default",0.8);
				      
				
				break;
			default:
				$(mid).fadeOut("default");
				$(id).fadeOut("default");
				
		}
		return false;
	}
	function plzLightboxHide(){
		plzLightboxToggle(0);
		return true;
	}
	
	
			  	 
				
			
