function openWindow(URL, winName, width, height){

	if(height=='' || !height)
	height=screen.height/2
	height_factor = ((screen.height/100)*85)
	if(height>=height_factor)
		height=height_factor;


	if(width=='' || !width)
		width=screen.width/2
	width_factor = ((screen.width/100)*95)
	if(width>=width_factor)
		width=width_factor;

	var top=((screen.height-height)/2)-(screen.height/20)
	var left=(screen.width - width) / 2 ;

		win=window.open(URL, winName, 'toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=yes,resizable=1,copyhistory=no,width='+width+',height='+height+',top='+top+',left='+left+'');
		win.focus();
}

function loadFlashObject(_id,_path,_w,_h,_bgColor,_params){
			//alert("INNN");
	var _paramsStr=_params.toString();
	//_paramsStr=_paramsStr.replace(/,/g,'');
	var _str= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="'+_id+'" name="'+_id+'" '
	_str+='width="'+_w+'" height="'+_h+'" '
	_str+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">'
	//_str+='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
	_str+='<param name="movie" value="'+_path+_id+'.swf" />'
	_str+='<param name="menu" value="false" />'
	_str+='<param name="scale" value="noscale" />'
	_str+='<param name="quality" value="high" />'
	_str+='<param name="swLiveConnect" value="true">'
	_str+='<param name="bgcolor" value="'+_bgColor+'" />'
	_str+='<param name="FlashVars" value="'+_paramsStr+'" />'
	_str+='<param name="allowScriptAccess" value="always" />'
	_str+='<embed src="'+_path+_id+'.swf" '
	_str+='scale="noscale" '
	_str+='swLiveConnect="true" '
	_str+='menu="false" '
	_str+='quality="high" '
	_str+='bgcolor="'+_bgColor+'" '
	_str+='FlashVars="'+_paramsStr+'" '
	_str+='width="'+_w+'" height="'+_h+'" '
	_str+='name="'+_id+'" id="'+_id+'" '
	_str+='play="true" '
	_str+='quality="high" '
	_str+='allowScriptAccess="always" '
	_str+='type="application/x-shockwave-flash" '
	_str+='pluginspage="http://www.macromedia.com/go/getflashplayer">'
	_str+='<\/embed>'
	_str+='<\/object>';
		//alert(_str);
	document.write(_str);   
}

