var popupStatus = 0;
var lightboxShirtStatus = 0;
var lightboxClipStatus = 0;

function loadPopup(){  
	if(popupStatus==0){ 
		$("#backgroundPopup").css({"opacity": "0.7"});
		$("#backgroundPopup").fadeIn("slow");  
		$("#popupLogin").fadeIn("fast");  
		popupStatus = 1;  
	}  
}
function loadLightboxShirt(){
	if (lightboxShirtStatus==0) {
		$("#backgroundPopup").css({"opacity": "0.7"});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupShirtViewer").fadeIn("fast");
		
		sIFR.replace(error, {
		  selector: '.sifrme',
		  css: '.sIFR-root { background-color: #000000; color: #FFFFFF; margin-left: 3px; font-size: 18px;}'
		});
		
		lightboxShirtStatus = 1;
	}
}
function loadLightboxClip(inVid){
	if (lightboxClipStatus==0) {
		$("#backgroundPopup").css({"opacity": "0.7"});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupClipViewer").fadeIn("fast");
		
		sIFR.replace(error, {
		  selector: '.sifrme',
		  css: '.sIFR-root { background-color: #000000; color: #FFFFFF; margin-left: 3px; font-size: 18px;}'
		});	
		lightboxClipStatus = 1;
	}
}
function disablePopup(){  
	if(popupStatus==1){  
		$("#backgroundPopup").fadeOut("slow");  
		$("#popupLogin").fadeOut("fast");  
		popupStatus = 0;  
	}  
}
function disableLightboxShirt() {
	if (lightboxShirtStatus==1) {
		$("#backgroundPopup").fadeOut("slow");
		$("#popupShirtViewer").fadeOut("fast");
		lightboxShirtStatus = 0;
	}
}
function disableLightboxClip() {
	if (lightboxClipStatus==1) {
		$("#backgroundPopup").fadeOut("slow");
		$("#popupClipViewer").fadeOut("fast");
		lightboxClipStatus = 0;
	}
}
function centerPopupShirt(){  
	//request data for centering  
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#popupShirtViewer").height();  
	var popupWidth = $("#popupShirtViewer").width();  

	//centering  
	$("#popupShirtViewer").css({  
		"position": "absolute",  
		"top": 190,  
		"left": windowWidth/2-popupWidth/2  
	});  

	//only need force for IE6  
	$("#backgroundPopup").css({  
		"height": windowHeight  
	});
}
function centerPopupClip(){  
	//request data for centering  
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#popupClipViewer").height();  
	var popupWidth = $("#popupClipViewer").width();  

	//centering  
	$("#popupClipViewer").css({  
		"position": "absolute",  
		"top": 190,  
		"left": windowWidth/2-popupWidth/2  
	});  

	//only need force for IE6  
	$("#backgroundPopup").css({  
		"height": windowHeight  
	});
}
function positionLoginPopup(){
	//request data for centering  
	var windowWidth = document.documentElement.clientWidth;  
	var windowHeight = document.documentElement.clientHeight;  
	var popupHeight = $("#popupLogin").height();  
	var popupWidth = $("#popupLogin").width();  

	//centering  
	$("#popupLogin").css({  
		"position": "absolute",  
		"top": 130,  
		"left": windowWidth/2-994/2+30
	});  

	//only need force for IE6  
	$("#backgroundPopup").css({  
		"height": windowHeight  
	});
}