//Pop-up Window v1.0
//modified from various sources
//by sam mateosian
//big room studios

function popUp(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	win = window.open(mypage, myname, winprops);
	
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus(); 
	}
	
}

//sample html:

//<script language=javascript type="text/javascript" src="popup.js">

//<a href="http://www.bigroomstudios.com/" onclick="popUp(this.href,'name','800','600','yes');return false;">www.bigroomstudios.com</a>


//Pop-up Window v2.0
//Pops up inline using iframe
//by sam mateosian
//big room studios

var popup_iframe_id = "iframe_popup";

function show_popup(url, width, height) {
	
	
	var iframe = new getObj(popup_iframe_id);
	
	iframe.obj.src = url;
	
	
	
	var left = (document.body.clientWidth - width) / 2;
	
	var top = (document.body.clientHeight - height) / 2;
	
	iframe.style.width = width + 'px';
	
	iframe.style.height = '5px';
	
	iframe.style.left = left  + 'px';
	
	iframe.style.top = top + 'px';
}

function hide_popup(){
	
	var iframe = new getObj(popup_iframe_id);
	
	iframe.obj.className = "popup_hidden";
}

function resize_popup(){
	
	var iframe = new getObj(popup_iframe_id);
	
	iframe.obj.className = "popup_visible";
	
	//var width = iframe.obj.contentDocument.body.scrollWidth;
	
	var iframe_div = new getFrameObj('popup-frame', popup_iframe_id);
	
	var height;
	
	if(iframe_div.obj.offsetHeight){
	
		height = iframe_div.obj.offsetHeight;
		
		//alert(height);
		
	}else{
		
		height = iframe_document.body.scrollHeight;
	}
	//var left = (document.body.clientWidth - width) / 2;
	
	var top = (document.body.clientHeight - height) / 2 + document.body.scrollTop;
	
	//iframe.style.width = width + 'px';
	
	iframe.style.height = height + 'px';
	
	//iframe.style.left = left  + 'px';
	
	iframe.style.top = top + 'px';
	
	
}

//sample html:

//<script language=javascript type="text/javascript" src="popup.js">

//<a href="http://www.bigroomstudios.com/" onclick="popUp(this.href,'name','800','600','yes');return false;">www.bigroomstudios.com</a>