
	
	var popupStatus = 0;  
		
		// jQuery ------------------------------------
		
		$(document).ready(
			
			function()
			{	
				
					
				//  POPUP  -----------------------------------
				
				$("#modempuffbutton").click(function(){  
					//centering with css  
					centerPopup();  
					//load popup  
					loadPopup();  
						
				});
				
				$("#popupModemClose").click(function(){  
					disablePopup();  
				});  
				//Click out event!  
				$("#backgroundPopup").click(function(){  
					disablePopup();  
				});  
				//Press Escape event!  
				$(document).keypress(function(e){
					if(e.keyCode==27 && popupStatus==1){
						disablePopup();
					}
				});
				
				$('div#popup div#popupModem div.stores div.store a').click(storeClickHandler);
				
			}
		);
		
		//----------------------------------
		
		function storeClickHandler(){
			
			$('div#popup div#popupModem div.stores div.storeinfo').each(function(index){
				if($(this).height() >0){
					$(this).stop().animate({height:0, 'margin-bottom':'0px'},200);
				}
			});
			
			if($("div.storeinfo", $(this).parent()).height() == 168){
				//$(this).stop().animate({height:0, 'margin-bottom':'0px'},200);
			}else{
				$("div.storeinfo", $(this).parent()).stop().animate({height:168, 'margin-bottom':'20px'},200);
			}    
			//$('div#centerWrapper div#center div.blogcontent div.qna h1').removeClass('active');
			
		}
				
		//----------------------------------
		
		var popupStatus = 0;  

		function loadPopup(){  
			//loads popup only if it is disabled  
			if(popupStatus==0){  
				if ($.browser.msie){
					$("#backgroundPopup").css({  
						"opacity": "0.4",
						"display": "block"
					});
					
					$("#popupModem").css({  
						"display": "block"
					});
					  
				}else{
					$("#backgroundPopup").css({  
						"opacity": "0.4",
						"display": "block"
					});
					$("#popupModem").fadeIn("fast");
				}
				popupStatus = 1;  
			}  
			
		}  

		function disablePopup(){  
			//disables popup only if it is enabled  
			if(popupStatus==1){  
				if ($.browser.msie){
					$("#backgroundPopup").css({  
						"opacity": "0",  
						"display": "none"
					});
					
					$("#popupModem").css({  
						"display": "none"
					});
				}else{
					$("#backgroundPopup").fadeOut("fast");  
					$("#popupModem").fadeOut("fast");
				}
				
				popupStatus = 0;  
			}  
		}  


		function centerPopup(){  
		//request data for centering  
		var windowWidth = document.documentElement.clientWidth;  
		var windowHeight = document.documentElement.clientHeight;  
		var popupHeight = $("#popupModem").height();  
		var popupWidth = $("#popupModem").width();  
		//only need force for IE6  

		$("#backgroundPopup").css({  
		"height": windowHeight  
		});  

		}
		