function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//form
function fSubmit(F,O,V,D,P){
	if(P) F.method=P;
	if(!D) D=",";
	var ao=new Array(); ao=O.split(D);
	var av=new Array(); av=V.split(D);
	if(!F) return;
	for(i=0; i<ao.length; i++){ 		s="F."+ ao[i] + ".value=" + "\"" + av[i] + "\"\;";	eval(s); }
	F.submit();
}

// Macromedia Flash ActiveX object : version 1.3 090-8785-0169
// by kiss inc.
// 	"must" para : 				pVer, pURL, pW, pH, pAlign, pId, pFlashVars
//  default options :		
//			scale 		= (showAll, noBorder, noScale, exactFit)
//			loop			= ()
//			menu 			= ()
//			quality		= ()
//			bgcolor		= ()
//			allowScriptAccess = (sameDomain)
//			wmode			= ()
//			salign 		= (b, )
function embedFlash(pVer, pURL, pW, pH, pAlign, pId, pFlashVars, pOptionsNames, pOptionsValues) {
	
	TAG_FOR_OPTIONS = '';
	ATTR_FOR_OPTIONS = '';
	delimeter = ",";
	var ao=new Array(); if(pOptionsNames.length) ao=pOptionsNames.split(delimeter);
	var av=new Array(); av=pOptionsValues.split(delimeter);
	for(i=0; i<ao.length; i++){
		TAG_FOR_OPTIONS  += ' <param name="' + ao[i] + '"' + ' value="' + av[i] + '" />';
		ATTR_FOR_OPTIONS += ' ' + ao[i] + '="' + av[i] + '"';
	}
	
	TAG_OBJECT = 
		'<object ' +
		' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' +
		' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + pVer + '"' +
		' width="'+pW+'" '  +
		' height="'+pH+'" ' +
		( (pAlign) ? ' align="'+pAlign+'" ' : '') +
		' id="'+pId+'" ' +
		' >' +
		'  <param name="movie" value="'+pURL+'" />' +
		'  <param name="flashvars" value="'+pFlashVars+'" />' +
		TAG_FOR_OPTIONS;
	
	TAG_EMBED =
		' <embed ' +
		' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' +
		' src="'+pURL+ '?'+pFlashVars+'" ' +
		' width="'+pW+'" '  +
		' height="'+pH+'" ' +
		( (pAlign) ? ' align="'+pAlign+'" ' : '') +
		' name="'+pId+'" ' +
		ATTR_FOR_OPTIONS +
		' />'+
		'</object>';
		
	OBJCOMMAND = TAG_OBJECT + TAG_EMBED;

	document.write( OBJCOMMAND );

}


function MoveWin(){
 var win_width = screen.width;
 var win_height = screen.height;
 new_win=window.open("index.html","livecamera",",width=320,height=240,left=0,top=0")
 new_win.moveTo(win_width/4, win_height/4);
 if(document.all){ // IE
	new_win.resizeTo(win_width/2, win_height/2);
 }
 if(document.layers){ // NN
	new_win.outerWidth = win_width/2;
	new_win.outerHeight = win_height/2;
 }
}
function PopWindow(URL, WinName, W, H, Scroll) {//CenterPopUpWindow
 	var WinWidth = (screen.width - W) / 2;
 	var WinHeight = (screen.height - H) / 2;
 	WinDetail = 'height='+H+',width='+W+',top='+WinHeight+',left='+WinWidth+',scrollbars='+Scroll;
 	Win = window.open(URL, WinName, WinDetail);
 	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}
function FullScreen( url ){//FullScreen
	var str="left=0,screenX=0,top=0,screenY=0";
	if(window.screen){
		var ah=screen.availHeight;
		var aw=screen.availWidth;
		str+=",height="+ah;
		str+=",width="+aw;
	}
	var temp=window.open(url,'fullscreen',str);
	temp.moveTo(0,0);
	temp.resizeTo(aw,ah);
}