window.focus();
var minWidth = 995;
var minHeight = 567;
var flashId = 'sandisk';


function initSWFSize(){
	setMinSize(flashId,minWidth,minHeight);
}

window.onresize = function(){
	setMinSize(flashId,minWidth,minHeight);
}

function setObj(idName){
	return document.all ? document.all(idName) : document.getElementById ? document.getElementById(idName) : document.layers[idName];
}

function setMinSize(id, minWidth, minHeight) {
	if (!id || !minWidth || !minHeight) { return; }
	var Obj = setObj(id);
	if (Obj) {
		if (getWindowWidth() <= minWidth) {
			if (Obj.style) { Obj.style.width = minWidth+'px'; }
			Obj.width = minWidth;
		} else {
			if (Obj.style) { Obj.style.width = '100%'; }
			Obj.width = '100%';
		}
		if (getWindowHeight() <= minHeight) {
			if (Obj.style) { Obj.style.height = minHeight+'px'; }
			Obj.height = minHeight;
		} else {
			if (Obj.style) { Obj.style.height = '100%'; }
			Obj.height = '100%';
		}
	}
}


function getWindowWidth(){
	if(window.innerWidth) return window.innerWidth;
	if(document.documentElement && document.documentElement.clientWidth){
		return document.documentElement.clientWidth;
	}
	else if(document.body && document.body.clientWidth){
		return document.body.clientWidth;
	}
	return 0;
}


function getWindowHeight(){
	if(window.innerHeight) return window.innerHeight;
	if(document.documentElement && document.documentElement.clientHeight){
		return document.documentElement.clientHeight;
	}
	else if(document.body && document.body.clientHeight){
	return document.body.clientHeight;
	}
	return 0;
}

var realSizeWidth =getWindowWidth();
var realSizeHeight = getWindowHeight();

if(!!realSizeWidth < minWidth)ratedWidth = realSizeWidth;
if(!!realSizeHeight < minHeight)ratedHeight = realSizeHeight;

if(realSizeWidth<minWidth){
	ratedWidth = minWidth;
}else{
	ratedWidth = "100%";
}

if(realSizeHeight<minHeight){
	ratedHeight = minHeight;
}else{
	ratedHeight = "100%";
}
