// par lex (lex@silex.tv)
// 2005
/*
	this file is part of SILEX
	SILEX : RIA developement tool - see http://silex.sourceforge.net/

	SILEX is (c) 2004-2007 Alexandre Hoyau and is released under the GPL License:

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License (GPL)
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.
	
	To read the license please visit http://www.gnu.org/copyleft/gpl.html
*/

function adjustSilexWindowSize(h)
{
	var silexFrameName_str="flashcontent";
//	move(silexFrameName_str,0,0,w,h);
	set_frame_prop(silexFrameName_str,'height',h);
}
function move(id_str,x,y,w,h)
{
	set_frame_prop(id_str,'top',y);
	set_frame_prop(id_str,'left',x);
	set_frame_prop(id_str,'width',w);
	set_frame_prop(id_str,'height',h);
//	set_frame_prop(id_str+'_content','width',w);
//	set_frame_prop(id_str+'_content','height',h);
}
function set_frame_prop(id_str,prop_str,valeur_num)
{
/*	debug_lex(get_frame(id_str));
	alert(prop_str+" = "+get_frame(id_str)[prop_str]);
	alert(prop_str+" <- "+valeur_num);
	alert("type de "+prop_str+" : "+typeof(get_frame(id_str)[prop_str]));
/**/	
	get_frame(id_str)[prop_str]=valeur_num;
}
function refresh_frame(id_str)
{
	get_obj(id_str).innerHTML=get_obj(id_str).innerHTML;
}
function get_frame(id_str)
{
	return get_obj(id_str).style;
}
function get_obj(id_str)
{
	 if (document.layers) 
	 { 
	 	 //alert("1");
	     return document.layers[id_str].document; 
	 } 
	 else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape")
		 { 
		 	//alert("2");
		   return document.getElementById(id_str); // ou  return document.getElementById(id_str).document; ?
		 }
		 else if (document.all)
		 {
		 	//alert("3");// ICI DANS IE
		 	//alert(debug_lex(document.all[id_str].document));
		 	return document.all[id_str];
		 }
//	 else alert("Erreur : impossible de trouver la frame "+id_str+" dans votre navigateur");
	 return null;
}

