function LoadSWFmain(movie, width, height, id) {


	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+id+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain">')
	document.write('<param name="movie" value="'+movie+'">\n');
	document.write('<param name="quality" value="high">\n');
	document.write('<param name="menu" value="false">\n');
	document.write('<param name="scale" value="noscale">\n');
	document.write('<param name="salign" value="lt">\n');
	document.write('<param name="wmode" value="transparent">\n');	
	document.write('<param name="bgcolor" value="#ffffff">');
	document.write('<embed src="'+movie+'" width="'+width+'" height="'+height+'"  name="'+id+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"  scale="noscale"  salign="lt" wmode="transparent"></embed>\n');
	document.write('</object>\n');

	
} 

function fadeEfectClass(b) {
	
	this.changeOpac = changeOpac;
	this.fadeIn = fadeIn;
	this.fadeOut = fadeOut;
	
	var b = b;
	var opcaityTimer1;
	var opcaityTimer2;
	var opacityN = 1;
	
	function changeOpac(opacity, id, newOpacity) {
	    var object = document.getElementById(id).style;
	 try {   object.opacity = (opacity / 100); } catch (e) { }
	 try {   object.MozOpacity = (opacity / 100);} catch (e) { }
	 try {   object.KhtmlOpacity = (opacity / 100);} catch (e) { }
	 try {   object.filter = "alpha(opacity=" + opacity + ")";} catch (e) { }
	
	 if(newOpacity) opacityN = newOpacity;
	
	}
	
	
	function fadeIn(id) { 
		if(opacityN < 100) { 
			clearTimeout(opcaityTimer2);
			opacityN = opacityN+10;
			changeOpac(opacityN, id);
			opcaityTimer1 = setTimeout(b+'.fadeIn(\''+id+'\')', 15);
		}
	}
	
	function fadeOut(id, callback) { 
		if(opacityN > 9) {
			clearTimeout(opcaityTimer1);
			opacityN = opacityN-10;
			changeOpac(opacityN, id);
			opcaityTimer2 = setTimeout(b+'.fadeOut(\''+id+'\', \''+callback+'\')', 15);
		} else {
			if (callback) eval(callback);
		}
	}
}

b1 = new fadeEfectClass('b1');
b2 = new fadeEfectClass('b2');
b3 = new fadeEfectClass('b3');
b4 = new fadeEfectClass('b4');
mainAlphaObj = new fadeEfectClass('mainAlphaObj');



function loadImages() {
	
	if (document.getElementById) {
		loadImagesProceed();
	} else {
		if (document.layers) {
			loadImagesProceed();
		} else {
			loadImagesProceed();
		}
	}
}

function loadImagesProceed() {
	document.wstep.SetVariable("_root.stat", 'loaded');
}

function loadImagesDone() {
	document.getElementById('preloader_main_swf').style.display = 'none';
	document.getElementById('mainTable').style.display = 'block';
	if (document.body.scrollHeight > document.body.offsetHeight) { 
		H = document.body.scrollHeight; }
	else { 
		H = document.body.offsetHeight; 
	}
	
	document.getElementById('preloader_main').style.height  = H+"px";
	//alert(H);
	
	//mainAlphaObj.changeOpac(100, 'preloader_main', 100);
	//mainAlphaObj.fadeOut('preloader_main', 'loadImagesPreloaderOff();');
	
	loadImagesPreloaderOff();
}

function loadImagesPreloaderOff() {
	document.getElementById('preloader_main').style.display = 'none';
	//alert('aaa');
}

function switchOnMark(n) {
	name = 'mark' + n;
	mark_on = 'point.jpg';
	document.getElementById(name).src = 'image/' + mark_on;
}

function switchOffMark(n) {
	name = 'mark' + n;
	mark_off = 'point_off.jpg';
	document.getElementById(name).src = 'image/' + mark_off;
}

function removeWhitespace(xml) {
	var loopIndex;
	
	for (loopIndex = 0; loopIndex < xml.childNodes.length; loopIndex++) {
		var currentNode = xml.childNodes[loopIndex];
		if (currentNode.nodeType == 1) {
			removeWhitespace(currentNode);
			}
		if (((/^\s+$/.test(currentNode.nodeValue))) && (currentNode.nodeType == 3)) {
			xml.removeChild(xml.childNodes[loopIndex--]);
		}
	}
	return xml;
}

var mozillaFlag = false;
function CreateHttpObj() {
		
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_object = new XMLHttpRequest();
		mozillaFlag = true;
		if (http_object.overrideMimeType) {
			//http_object.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_object = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_object = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
            }
        }
	
	if (!http_object) {
            alert('XMLHTTP Error');
            return false;
	} else {
		return 	http_object;
	}
	
}


function ToggleAdBOX(v) {
	s = (v) ? 'block' : 'none';
	document.getElementById('adBOX').style.display = s;
}



