var picture;
var pWidth;
var pHeight;

function init() {

	picture = document.getElementById("picture");

	if(picture) {
		pWidth = picture.width;
		pHeight = picture.height;

		resizePicture();

		addEvent(window, "resize", resizePicture, false);
	}
}

function getScreenWidth() {
	
	var width = 0;
	
	if(document.documentElement.clientWidth) {
		width = document.documentElement.clientWidth;
	} else if(document.body.clientWidth) {
		width = document.body.clientWidth;
	} else if(window.innerWidth) {
		width = window.innerWidth;
	}
	
	return width;
}
 
function resizePicture() {

	var sWidth = getScreenWidth();

	if(sWidth > 0) {

		var ratio = pWidth / pHeight;
	
		var nWidth = Math.round(sWidth*(9/10));
		if(nWidth > pWidth) {
			nWidth = pWidth;
		}
	
		var nHeight = Math.round(nWidth/ratio);
	
		picture.width = nWidth;
		picture.height = nHeight;
	}
}

function addEvent(element, evtType, fName, capturingPhase) {

	if (element.addEventListener) {
		element.addEventListener(evtType, fName, capturingPhase);
		return true;
	} else if (element.attachEvent) {
		var r = element.attachEvent('on' + evtType, fName);
		return r;
	} else {
		element['on' + evtType] = fName;
		return true;
	}
}
 
function bustFrames() {

	if ( top != self ) {
		top.location = self.document.location;
	}
}

bustFrames();
document.oncontextmenu = new Function("return false");