var urlI;

function init() {
  setTimeout("onresize = reload", 1000);
  alertSize();
  var iframeUrl=readIframeUrl();
  
  if (iframeUrl){
    iframe=document.getElementById('contentFrame');
    iframe.src=iframeUrl;
    document.forms[0].urli.value=iframeUrl;
  }
}

function readIframeUrl(){
	var queryString= location.search;
	if(!queryString || queryString.lenght==0)
	 return('home.html');
	//alert(queryString);
	var ind1, ind2;
	ind1=queryString.indexOf('=');
	ind2=queryString.length;
	var iframeUrl=queryString.substring(ind1+1,ind2);
	//alert(iframeUrl);
	return iframeUrl;
}

function reload(){
  document.forms[0].submit(); 
}

function alertSize() {
  var navHeight=document.getElementById('navigation').offsetHeight;
  //alert(navHeight);
  var bottomMargin =0;
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
	 bottomMargin=10;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
	 bottomMargin=30;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
	 bottomMargin=30;
  }

  var cFrame= document.getElementById('tdFrame');
  //window.alert( 'Height = '+cFrame.height);
  var hFrame= document.getElementById('header');
  var fFrame= document.getElementById('footer');
  var result= myHeight-hFrame.height-fFrame.height -bottomMargin;
  if(result<100){
    result=100;
  }
  if(result>navHeight)
    cFrame.height=result;
  else
    cFrame.height=navHeight;
  //window.alert( 'Height = '+cFrame.height);
  
}

function linkOver(par,over){
  var img=document.getElementById(par);
  if(over){
     img.src='img/'+par+'_over.png';
  }
  else{
     img.src='img/'+par+'.png';
  }
}


function  moveTo(url){
	var hiddenF=document.getElementById('urli');
	hiddenF.value=url;
   	var iframe=document.getElementById('contentFrame');
	iframe.src=url;
}

function EvalSound(soundobj) {
  var thissound= eval("document."+soundobj);
  thissound.Play();
}

function StopSound(soundobj) {
  var thissound= eval("document."+soundobj);
  thissound.Stop();
}
