var popWin;
function openPop(url,width,height){

	if(!popWin||popWin.closed){
		popWin = window.open(url+".htm",'',"width="+width+",height="+height);
	}else{
		popWin.location=url+".htm"
		popWin.focus();
	}
}
var mobileWin;

function openWindow(url1){
	if(!mobileWin || mobileWin.closed){
		if(isNav){
			mobileWin = window.open(url1,"Mobile","width=760,height=450,scrollbars");
		}else{
			mobileWin = window.open(url1,"Mobile","width=768,height=450,scrollbars");
		}
	} else {
		mobileWin.location = url1;
		mobileWin.focus();
	}
}
function openFrame(url){
	var content ="<html><head><title>MobileFantasy.com</title></head>";
	content += "<frameset rows=\'40,*,21\' frameborder=\'NO\' border=\'0\' framespacing=\'0\'>";
	content += "<frame name=\'topFrame\' scrolling=\'NO\' noresize src=\'flashNav.htm\'>";
	content += "<frame name=\'mainFrame\' src=\'"+url+"\'>";
	content += "<frame name=\'bottomFrame\' scrolling=\'NO\' noresize src=\'bottomNav.htm\'>";
    content += "</frameset>";
	content += "<noframes><body bgcolor=\'#FFFFFF\' text=\'#000000\'></body></noframes></html>";
	document.write(content);
	document.close();
} 
var mapWin;
function openMap(location){
	if(location=="Northridge"){
		var address = "9353 Reseda Blvd. Northridge, CA 91324";
	}else{
		address = "13752 Ventura Blvd. Sherman Oaks, CA 91603";
	}	
	 var content = "";
	 content+="<html><head><title>"+location+" Store</title></head>";
	 content+="<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>";
	 content+="<table border=0 cellpadding=0 cellspacing=0>";
	 content+="<tr><td align=\'center\'><p style=\'font:verdana;font-size:8pt;font-weight:bold\'>"+address+"</p></td></tr>";
	 content+="<tr><td><img src=\'images/map/"+location+"Close.gif\'></td></tr>";
	 content+="<tr><td><hr></td></tr>";
	 content+="<tr><td><img src=\'images/map/"+location+"Far.gif\'></td></tr>";
	if(!mapWin||mapWin.closed){
		mapWin = window.open('','map','height=245,width=408,scrollbars');
		mapWin.document.write(content);
		mapWin.document.close();
	}else{
		mapWin.focus();
		mapWin.document.write(content);
		mapWin.document.close();
	}
}

//This function dynamically writes out the top frame in the popup
function writeMainPop(imagePath,description){
	var content = "<html><head><title>Mobile Fantasy</title>";
	content +="<link rel=stylesheet type=\'text/css\' href=\'../styles/mobileFAPopup.css\'></head>";
	content += "<body>";
	content += "<table cellpadding=0 cellspacing=0 border=0 align=\'center\'><tr><td align=\'center\'>";
	content += "<img src=\'"+imagePath+"\' border=0></td></tr>"
	content += "<tr><td><p>"+description+"</p></td></tr></table>";
	content += "</body></html>";
	parent.popMain.document.write(content);
	parent.popMain.document.close();

}