
/* Functions for new style rollovers; these are actual event handlers,   not just called from an event handler. */
function rollover_handler(e) {
  // get the source element in a cross-browser way
  if (window.event) {
	thisimg = window.event.srcElement;
  }
  else if (e.target) {
	thisimg = e.target;
  } 
  else {
	return;
  }
  //alert(thisimg.src);
  if(thisimg.src.indexOf('/x.gif') != -1){
		thisimg.src = thisimg.src_origin.replace(/(\.[a-z0-9]+)$/i,'_on$1');
		
		if(supersleight != undefined){
			supersleight.fixPngImg(thisimg);
		}
	}
  else thisimg.src = thisimg.src.replace(/(\.[a-z0-9]+)$/i,'_on$1');
  //alert(thisimg.src);
}
function rollout_handler(e) {
  // get the source element in a cross-browser way
  if (window.event) {
	thisimg = window.event.srcElement;
  }
  else if (e.target) {
	thisimg = e.target;
  }
  else { 
	return;
  }
  
  if(thisimg.src.indexOf('/x.gif') != -1){
		thisimg.src = thisimg.src_origin;
		
		if(supersleight != undefined){
			supersleight.fixPngImg(thisimg);
		}
  }
  else thisimg.src = thisimg.src.replace(/_on(\.[a-z0-9]+)$/i,'$1'); 
  
}


/* post variables using <a href="javascript:postwith('post.aspx',{user:'peter',cc:'aus'})">link text</a>*/
function postwith (to,p) {
  var myForm = document.createElement("form");
  myForm.method="post" ;
  myForm.action = to ;
  for (var k in p) {
    var myInput = document.createElement("input") ;
    myInput.setAttribute("name", k) ;
    myInput.setAttribute("value", p[k]);
    myForm.appendChild(myInput) ;
  }
  document.body.appendChild(myForm) ;
  myForm.submit() ;
  document.body.removeChild(myForm) ;
}


function getWinSize() {
  var myWidth = 0, myHeight = 0;
  var dimensions = new Array();
  
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  dimensions[0] = myWidth;
  dimensions[1] = myHeight;
  
  return dimensions;
  
}

