function ElementGetById(elementid) {
	if (document.elements) {
		return document.elements[elementid];
	} else if (document.getElementById) {
		return document.getElementById(elementid);
	} else if (document.all) {
		return document.all[elementid];
	}
	return null;
}


function popupwin(url,name,win_height,win_width) {
	pos_horizon = ((screen.width/2)-(win_width/2));
	pos_vertical = ((screen.height/2)-(win_height/2));
	window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
}

function preloadImg(url) {
	pic= new Image(0,0);
	pic.src=url;

}

function PageSizeCheck() {
	var element = ElementGetById('pagex');
	var width = window.innerWidth;
	if (document.body.clientWidth > 0){
		width = document.body.clientWidth;
	} else if (window.innerWidth > 0){
		width = window.innerWidth;
	} else if (document.documentElement.clientWidth > 0) {
		width = document.documentElement.clientWidth;
	}
	if (width > 900){
		var x = document.getElementsByTagName('div');
		for (var i = 0; i != x.length; i++) {
			if (x[i].className == 'page'){
				x[i].className ='page_center';
			}
		}
	}
}


function popupwin(url,name,win_height,win_width) {
	pos_horizon = ((screen.width/2)-(win_width/2));
	pos_vertical = ((screen.height/2)-(win_height/2));
	window.open(url,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
}

