var currentsub = "contactWin";

function MM_findObj(n, d) { //v3.0
  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); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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];}
}

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 DocPopUp(url,x,y){
	var doc = window.open(url,"docpopup","width="+x+",height="+y+",left=100,top=50,screenX=100,screenY=50,scrollbars=yes,location=no,menubar=no,toolbar=no,status=no,resizable=no");
}

function ImgPopUp(file, name) {
	var doc = window.open('','imgpopup','scrollbars=auto,status=no,toolbar=no,location=no,directories=no,resizeable=no,left=0,top=0,screenX=0,screenY=0,width=1,height=1');
	doc.document.writeln('<html>\n<head>\n<title> '+name+' </title>\n<script language="javascript">');
	doc.document.writeln('<'+'!-- \nfunction resize() {\n var i=50;\n if (document.images[0]) {window.resizeTo(document.images[0].width+i, document.images[0].height+(i*1.4)); self.moveTo((screen.width-document.images[0].width)/2.2,(screen.height-document.images[0].height)/4) }\nself.focus();\n}\n/'+'/--'+'>');
	doc.document.writeln('</script></head><body bgcolor="#000000" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" onLoad="resize();">');
	doc.document.writeln('<center>\n<br><img src="images/'+file+'" alt="'+name+'" border="1">\n</center></body>\n</html>');
    doc.document.close();
}

function updateSub(which){
	MM_showHideLayers(currentsub,'','hide',which,'','show');
	currentsub = which;
}

function view(name,movie,x,y,format) {
	winX = 400;
	winY = 400;
	Left = (screen.width) ? (screen.width-winX)/2 : 0;
	Top  = (screen.height) ? (screen.height-winY)/2 : 0;
	var header = '<html>\n<head><title> '+name+' </title></head>\n';
	var win = window.open('','popup','scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizeable=no,top='+Top+',left='+Left+',width='+winX+',height='+winY);
	win.document.write(header);
	win.document.write('<body bgcolor="#113344" text="Gray">\n<table width="100%" height="100%"><tr><td>\n<center>\n');
	win.document.write('<font face="Arial, geneva, helvetica, san-serif" size="2"><h4>'+name+'</h4>\n');
	if (format=='qt'){
		movie=movie+'QT.mov';
		y = y+16; <!-- for controller -->
		win.document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="'+x+'" HEIGHT="'+y+'" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n<PARAM name="SRC" VALUE="'+movie+'">\n<PARAM name="AUTOPLAY" VALUE="true">\n<PARAM name="CONTROLLER" VALUE="true">\n<PARAM name="TARGET" VALUE="myself">\n<embed src="'+movie+'" width='+x+' height='+y+' controller="true" pluginspage="http://www.apple.com/quicktime/download/" bgcolor="black">\n</object>\n');
	} else {
		y = y+40; <!-- for controller -->
		movie=movie+'WM.wmv';
		win.document.write('<OBJECT CLASSID="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" WIDTH="'+x+'" HEIGHT="'+y+'" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" id="MediaPlayer" type="application/x-oleobject">\n<PARAM name="SRC" VALUE="'+movie+'">\n<PARAM name="AUTOPLAY" VALUE="true">\n<PARAM name="CONTROLLER" VALUE="true">\n<PARAM name="TARGET" VALUE="myself">\n<embed src="'+movie+'" width='+x+' height='+y+' type="application/x-mplayer2" controller="true" pluginspage="http://www.microsoft.com/windows/windowsmedia/" bgcolor="black">\n</object>\n');
	}
	win.document.write('<p><br><small><a href="javascript:window.close();">Close Window</a></small></font>\n');
	win.document.write('</center>\n</td></tr></table>\n</body>\n</html>');
    win.document.close();
}