var thisbrowser = msieversion();

if ( thisbrowser >= 7)
	//This is Internet Explorer > 7
	document.write ( "<link rel=\"stylesheet\" href=\"inc/styles.css\" type=\"text/css\" media=\"screen\">" );
else if ( thisbrowser >= 4)
	//This is Internet Explorer less than 7 and greater than 4
	document.write ( "<link rel=\"stylesheet\" href=\"inc/styles_oldie.css\" type=\"text/css\" media=\"screen\">" );
else if ( thisbrowser >= 3 )
	//This is Internet Explorer 3
	document.write ( "<link rel=\"stylesheet\" href=\"inc/styles_oldie.css\" type=\"text/css\" media=\"screen\">" );
else
	//This is another browser
	document.write ( "<link rel=\"stylesheet\" href=\"inc/styles.css\" type=\"text/css\" media=\"screen\">" );

function scrollto(id1,id2)
{
if (thisbrowser == 0 || thisbrowser >= 7)
{ 
	coordinates_1 = getAnchorPosition(id1);
	coordinates_2 = getAnchorPosition(id2);
	var ypos_1 = coordinates_1.y;
	var ypos_2 = coordinates_2.y;
	var scrollpos = parseInt(ypos_2 - ypos_1);
	//alert("id1: "+id1);
	//alert("id2: "+id2);
	//alert("scrollpos: "+scrollpos);
	
	window.scroll(0,scrollpos); // horizontal and vertical scroll targets
}
}

function eheightonresize(id)
{
if ( thisbrowser > 0)
{ 
  var myWidth = 0, myHeight = 0;
  var myWidth1 = 0, myHeight1 = 0;
  var diff = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth1 = window.innerWidth;
    myHeight1 = window.innerHeight;
	// do nothing...
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
		if (msieversion() >= 7)
		{
    		myWidth1 = window.innerWidth;
    		myHeight1 = window.innerHeight;
			if(myHeight1 > 0) {
				if(myHeight1 < 480) document.getElementById(navbar_container).style.top=105;
				else document.getElementById(navbar_container).style.top=150;
			}
			// do nothing else...
		}
		else
		{
    		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;
  }
  if(myHeight > 0)
  {
  	var new_h = myHeight - 175;
	document.getElementById(id).style.height=new_h;
	document.getElementById("navbar_container").style.height = myHeight - 150;
  }
}
}
function PageQuery(q) {
if(q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) {
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; } 
}
function queryString(key){
var page = new PageQuery(window.location.search); 
return unescape(page.getValue(key)); 
}
function processItem(key){
if(queryString(key)=='false') 
{
// do nothing
//alert("you didn't enter a querystring item.");
}else{
//alert(queryString(key));
scrollto('content_area',queryString(key));
}
}
