﻿//Javscript
window.onload = function (){
	$('wp').style.width = $winwh()[0] +'px';
}





function reSize(){
	var wi = 997;
	if (navigator.appName == "Netscape")
		wi = 333;
	else if (navigator.appName.indexOf("Microsoft") >= 0) {
		if (navigator.appVersion.indexOf("MSIE 7") >= 0) {
			wi = 1003;
		} else {
			wi = 997;
		}
	}
	
	var bodyWidth = $winwh();
	if (bodyWidth[0] > wi) {
		if (navigator.appName == "Netscape")
			wi = bodyWidth[0]-5;
		else if (navigator.appName.indexOf("Microsoft") >= 0) {
			if (navigator.appVersion.indexOf("MSIE 7") >= 0) {
				wi = bodyWidth[0]-5;
			} else {
				wi = bodyWidth[0]-4;
			}	
		}
	}
	wi =  $winwh()[0]
	return wi;
} 

//---
function $(e){return document.getElementById(e);}
function $random(min, max){return Math.floor(Math.random() * (max - min + 1) + min);};
function filltext(words){
	var txt=["This is just some filler text", 
				   "this is sample text", 
				   "Demo content nothing to read here"];
	for (var i=0; i<words; i++){
		document.write(txt[$random(1,3)]+" ")
	}
}
function $winwh(){
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = scrollMaxY ? window.innerWidth-17 : window.innerWidth;
			winH = scrollMaxX ? window.innerHeight-17 : window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.clientWidth;
			winH = document.body.clientHeight;
		}
	}
	return [winW,winH]
}