loaded=false;
function resizerWhileLoad() {
	Modify('all');
	if (!loaded) setTimeout("resizerWhileLoad()",1);
}
resizerWhileLoad();

function Modify(objid) {
	if ((document.body) && ((w = document.body.clientWidth) || (w = innerWidth))) {
		if(obj = getObj(objid)) obj.style.width = SizeIs(w)+'px';
	}
}


function SizeIs(w) {
	minContentSize = 770
	maxContentSize = 970
	maxWindowSize = 1170
	if (w > maxWindowSize) return maxContentSize;
	else if (w > minContentSize) return (minContentSize + Math.round((w-minContentSize)*(maxContentSize - minContentSize)/(maxWindowSize - minContentSize)));
	else return minContentSize;
}



function getObj(obj){
	return (o = document.getElementById(obj))? o : document.all[obj];
}

function PopUp(name,w,h,scrollbars) {
	window.open('about:blank', name, 'scrollbars='+scrollbars+', width='+w+', height='+h+', left='+(screen.availWidth-w)/2+',top='+(screen.availHeight-h)/2+'');	
	return true;
}

function opacity(obj,mode) {
	if(mode) obj.style.filter='alpha(opacity=60)';
	else obj.style.filter='alpha(opacity=40)';
}

window.onload = function() {
	loaded = true;
}

window.onresize = function() {
	Modify('all');
}

/*----------------------------------------------------------------------------------------------
						Initialization of aport form (needs for 'back' operation)
//--------------------------------------------------------------------------------------------*/
function _Do(section) {
	section = (section) ? section : 'std';
	Switch(section);
}
/*----------------------------------------------------------------------------------------------
						Control of object properties
//--------------------------------------------------------------------------------------------*/
function ObjCtl(obj,property,value) {
	if(obj = getObj(obj)) obj.style[property] = value;
}
/*----------------------------------------------------------------------------------------------
						Switch between sections of aport form
//--------------------------------------------------------------------------------------------*/
function Switch(section) {
	var fields = new Array ('std','ref','img','mp3','love');
	for (i=0; i<fields.length; i++) {
		ObjCtl(fields[i],'background','#d3d5d6');
		if (navigator.userAgent.indexOf ("MSIE 5") != -1) ObjCtl(fields[i],'cursor','hand');
		else ObjCtl(fields[i],'cursor','pointer');
	}
	ObjCtl(section,'background','#f9fafb');
	ObjCtl(section,'cursor','default');
}
/*----------------------------------------------------------------------------------------------
						Submit aport form
//--------------------------------------------------------------------------------------------*/
function AddQuery(section) {
	with(document.forms.search) {
		if(That.value != section) {
			That.value = section;
			if(r.value) {
				Switch(section);
				submit();
			}
			else {
				Switch(section);
			}
		}
	}
}
function schemewin(link) {
wnd=window.open('','scheme','width=530,height=530,scrollbars=yes')
with (wnd.document) {
open()
write('<html><style>body {padding:0;margin:0}</style>')
write('<body onload="resizeBy(document.images[0].width-500,document.images[0].height-500)">')
write('<table width=100% height=100%><tr><td align=center valign=middle>')
write('<img src="'+link.href+'" onclick="window.close()">')
write('</td></tr></table>')
write('</body></html>')
close()
}
return false
}
