/* Estudio Izus - Common scripts - www.estudioizus.com */

/* POPUP */
function Popup(url,name,width,height,resize,scroll) {
	var dialogWin = new Object();
	dialogWin.width = width;
	dialogWin.height = height;
	now = new Date();
	var millis=now.getTime();
	var mstr=""+millis;
	if (navigator.appName == "Netscape") {
		dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
		dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
		var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	} else if (document.all) {
		dialogWin.left = (screen.width - dialogWin.width) / 2;
		dialogWin.top = (screen.height - dialogWin.height) / 2;
		var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',toolbar=no,scrollbars=no,menubar=no,location=no,status=no,directories=no';
	}
window.open(url,name,attr);
}

function swap_image(id, image) 
{
	document.getElementById(id).src = image;
}

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+(strWidth+30)+",height="+(strHeight+16)+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

// global sIFR replacements

if(typeof sIFR == "function")
{

	sIFR.replaceElement(named({
							sSelector:"h1.title", 
							sFlashSrc:"assets/fonts/helvetica-condensed-bold.swf", 
							sColor:"#333333", 
							sLinkColor:"#000000", 
							sBgColor:"#FFFFFF", 
							sHoverColor:"#CCCCCC",
							sWmode:"transparent",
							nPaddingTop:0, 
							nPaddingBottom:0,
							sFlashVars:"textalign=left&offsetTop=0"
						}));
	sIFR.replaceElement(named({
							sSelector:".mainstory .teaser", 
							sFlashSrc:"assets/fonts/helvetica-condensed.swf", 
							sColor:"#333333", 
							sLinkColor:"#FF9900", 
							sBgColor:"#FFFFFF", 
							sHoverColor:"#CCCCCC",
							sWmode:"transparent",
							nPaddingTop:0, 
							nPaddingBottom:0,
							sFlashVars:"textalign=left&offsetTop=4&offsetLeft=0"
						}));
	sIFR.replaceElement(named({
							sSelector:".mainstory h2", 
							sFlashSrc:"assets/fonts/helvetica-condensed-bold.swf", 
							sColor:"#333333",
							sBgColor:"#FFFFFF", 
							sLinkColor:"#50A8D8",
							sHoverColor:"#FEB047",
							nPaddingTop:0, 
							nPaddingBottom:0,
							sFlashVars:"textalign=left&offsetTop=0&offsetLeft=0"
						}));	
};
