/*
 this script allows user to change styles of doc before it has been loaded
 it supposses that:  
  - there are two <link> elements BEFORE this script is included
  - theese <link>s have id="origCss" and id="userCss"
   (because of that my IE6 wasn't able to find them any other way than getElementById)
 usage: via url params
  http://this.html?cssUrl=http://your.css&defaultCss=off
 url params handler is made by yuhuu
  http://www.jakpsatweb.cz/javascript/priklady/http-get-vars-javascript.html
 
*/

if ( window.location.search )
{ 
 var vars = new Array();
 var field = window.location.search.substr(1).split("&");
 for ( i = 0; i < field.length; i++ ) { vars[field[i].split("=")[0]] = unescape(field[i].split("=")[1]); }
 if ( vars['cssUrl'] )
 {
  document.getElementById('userCss').href = vars['cssUrl'];
 } 
 if ( vars['defaultCss'] == 'off' )
 {
  document.getElementById('origCss').href = vars['cssUrl'];
 }
 if ( ( vars['help'] ) || ( !vars['defaultCss'] && !vars['cssUrl'] ) )
 {
  alert(' to attach your stylesheet use \'cssUrl\' parameter \n \n to disable default stylesheet add \'defaultCss=off\' param \n \n eg: \n http://this.html?cssUrl=http://your.css&defaultCss=off' );
 } 
}

