function flashCM(URL,width,height,vars,bgColor,winmode,quality) {

	var id=URL.split("/")[URL.split("/").length-1].split(".")[0];
	if(vars==null) vars='';
	if(bgColor==null) bgColor='#CEE0EB';
	if(winmode==null) winmode='window';

	document.write("	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "); 
	document.write("		width='"+width+"' height='"+height+"' id='"+id+"' align='middle' salign='lt'> ");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie' 						value='"+URL+"' /> ");
	document.write("	<param name='FlashVars' 					value='"+vars+"' /> ");
	document.write("	<param name='wmode' 						value='"+winmode+"' /> ");
	document.write("	<param name='menu' 							value='true' /> ");
	document.write("	<param name='quality'						value='"+quality+"' /> ");
	document.write("	<param name='bgcolor'						value='"+bgColor+"' /> ");
	document.write("	<param name='salign'						value=''lt' /> ");
	document.write("	<embed src='"+URL+"' flashVars='"+vars+"' wmode='"+winmode+"' menu='true' quality='"+quality+"' ");
	document.write("		bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' salign='lt'");
	document.write("		allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}

function downJava(url) {
	location.href = url;
}

function closeJava() {
	window.close();
}

function openFit() {
	var intLeft = (screen.availWidth/2) - 512;
	var intTop = (screen.availHeight/2) - 384;
	window.open('main.php?SizeMode=Fit&BandWidth=hBandWidth','Fredes','width=1280,height=960,top='+intTop+',left='+intLeft+',scrollbars=no,resizable=no');void(0);
}

function openFull() {
	var intWidth = screen.availWidth - 10;
	var intHeight = screen.availHeight - 10;
	window.open('main.php?SizeMode=Full&BandWidth=hBandWidth','Fredes','width='+intWidth+',height='+intHeight+',top=0,left=0,scrollbars=no,resizable=no');void(0);
}

function openFit_low() {
	var intLeft = (screen.availWidth/2) - 512;
	var intTop = (screen.availHeight/2) - 384;
	window.open('main.php?SizeMode=Fit&BandWidth=lBandWidth','Fredes','width=1280,height=960,top='+intTop+',left='+intLeft+',scrollbars=no,resizable=no');void(0);
}

function openFull_low() {
	var intWidth = screen.availWidth - 10;
	var intHeight = screen.availHeight - 10;
	window.open('main.php?SizeMode=Full&BandWidth=lBandWidth','Fredes','width='+intWidth+',height='+intHeight+',top=0,left=0,scrollbars=no,resizable=no');void(0);
}


function resizeFit(width,height) {
	autoSize(0, 0, 1280, 960);
}

function resizeFull() {
	var intWidth = screen.availWidth + 0;
	var intHeight = screen.availHeight + 20;
	autoSize(0, 0, intWidth, intHeight);
}


x = 0;
y = 0;
w = screen.availWidth;
h = screen.availHeight;
function win_move(tx, ty,tw,th) {
	cw = Math.abs(tw-w)>1
    ch = Math.abs(th-h)>1
	if (cw || ch) {
		w = w+(tw-w)*0.5;
		h = h+(th-h)*0.5;
		window.moveTo(x, y);
           x=(screen.width-w)/2;
		   y=(screen.height-h)/2 - 30;
		window.resizeTo(w, h);
	} else {
		clearInterval(id);
	}
}

function autoSize(x, y,w,h) {
	id = setInterval("win_move("+x+","+y+","+w+","+h+")", 10);
}

function setBookMark() {
	var FredesURL;
	var Fredes;
	FredesURL="http://www.fredes.com";
	Fredes="+ Fredes Interactive +";
	if (navigator.appName!="Netscape"){	
		window.external.AddFavorite(FredesURL, Fredes);	
	}else{
		window.location = FredesURL;
	}
}