<!--

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function print_preview() {
	// Switch the stylesheet
	setActiveStyleSheet('Print Preview');
	
	// Create preview message
	// add_preview_message();

	// Open print dialog box
	// window.print();
}


function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function gup( name )
{
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}

var toprint = gup( 'print' );

function open_print() {
printwin = window.open(self.location+'?print=yes','mywin','left=20,top=20,width=650,height=430,toolbar=1, menubar=1, location=1, status=1, scrollbars=1, resizable=1');
printwin.focus();
}

if (toprint == "yes"){
print_preview();
}


function changebg(what,color){
	what.style.backgroundColor=color;
}

function openWindow(x,y,width,height)
{
	var win = window.open(x,y,"width="+width+",height="+height+",menubar=no,scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes,left=100,top=70,screenX=100,screenY=70");
	win.focus();
}

// -->
