
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];}
}
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_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];}}
}

//::::Get Window Open
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//::::Get Window Open for Flash
function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}

//::::Get Window Open for Special Features
function newWindow(){
	window.open("/avc/camcorder/features/sd_or_hd/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=790,Height=674");
}

function newWinSorA(){
	window.open("/avc/camcorder/features/stylishoractive/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=700,Height=500");
}

function newWinSW20test(){
	window.open("/avc/camcorder/features/sw20_test_video/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=440,Height=256");
}

function newWinS9water(){
	window.open("/avc/camcorder/features/sdr-s10/pv/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=440,Height=256");
}
function newWinS9testing(){
	window.open("/avc/camcorder/features/product_testing/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
}
function newWinS10testing(){
	window.open("/avc/camcorder/features/sdr-s10/testing/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
}

function newWinOIS(){
	window.open("/avc/camcorder/features/ois/index.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=500,Height=360");
}
function newWinOISus(){
	window.open("/avc/camcorder/features/ois/america.html","name","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,Width=500,Height=360");
}

//::::Get Window Open for FullHD
function FSOpen(FSurl,FSwinName){
	winH = screen.availHeight;
	winW = screen.availWidth;
	w = screen.width;
	h = screen.height;
	if (w>1024&&h>768) {
		window.open(FSurl,FSwinName,"height="+winH+",width="+winW+",top=0,left=0,status=no,resizable=yes");
	}else{
		window.open(FSurl,FSwinName,"height="+winH+",width="+winW+",top=0,left=0,status=no,resizable=yes");
	}
}
// -->

var Middle=null;
function inf_open(s_data){
 Middle = window.open(s_data, "middle_win", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=1000,height=601");
}


//====_ Root-Sea, Inc. JavaScript Library _====//
/*-----------------------------------------------------
== Useragent  Library Ver2.2 == [2004/8/30]
2001-2003 (C) Root-Sea, Inc. All Rights Reserved.
Author:yoshihiro fujita
-----------------------------------------------------*/

var gUa = navigator.userAgent.toUpperCase();
var gBrw = navigator.appName.toUpperCase();
var gPlf = navigator.platform.toUpperCase();
var gVer = navigator.appVersion;
var gPlugin = navigator.plugins;

//::::Get Platform
var gWin = (gUa.indexOf("WIN", 0) != -1);
var gMacX = false;
if (gPlugin) {
	for (var p = 0; p < gPlugin.length; p++) {
		if (gPlugin[p].filename.indexOf("QuickTime Plugin.plugin", 0) != -1) {
			gMacX = true;
		}
	}
}
var gMacC = false;
if (!gMacX) {
	gMacC = (gUa.indexOf("MAC", 0) != -1);
}

//::::Get Browser
var gIE = (gBrw.indexOf("MICROSOFT INTERNET EXPLORER", 0) != -1);
var gNN = (gBrw.indexOf("NETSCAPE", 0) != -1);
var gGecko = (gUa.indexOf("GECKO", 0) != -1);
var gSafari = (gUa.indexOf("APPLEWEBKIT", 0) != -1);
var gOpera = (gUa.indexOf("OPERA", 0) != -1);
var gFire = (gUa.indexOf("FIRE", 0) != -1);

//::::Get Version
var gIE3 = (gVer.indexOf("MSIE 3", 0) != -1);
var gIE4 = (gVer.indexOf("MSIE 4", 0) != -1);
var gIE5 = (gVer.indexOf("MSIE 5", 0) != -1);
var gIE6 = (gVer.indexOf("MSIE 6", 0) != -1);
var gIE6 = (gVer.indexOf("MSIE 7", 0) != -1);
var gNN4 = (gNN && (gVer.indexOf("4.", 0) != -1));
var gNN6 = (gGecko && (gUa.indexOf("/6", 0) != -1));
var gNN7 = (gGecko && (gUa.indexOf("/7", 0) != -1));


//====_ Root-Sea, Inc. JavaScript Library _====//
/*-----------------------------------------------------
== Image Library == [2002/3/14]
2001-2004 (C) Root-Sea, Inc. All Rights Reserved.
Author:yoshihiro fujita
-----------------------------------------------------*/

//::::Image preload
function imagePreload() {
	var imgObj = new Array();
	if (document.images) {
		for (var i in gImgSrc) {
			imgObj[i] = new Image();
			imgObj[i].src = gImgSrc[i];
		}
		gPreloadFlag = true;
	}
}


//::::Image swap
function changeImg() {
	var parentObj, chgImgArg;
	if (gPreloadFlag) {
		chgImgArg = changeImg.arguments;
		chgImgArg.length % 2 == 0 ? parentObj = window : parentObj = document.layers[chgImgArg[chgImgArg.length - 1]];
		for (var i = 0; i < chgImgArg.length; i += 2) {
			if (i >= chgImgArg.length - 1) break;
			parentObj.document.images[chgImgArg[i]].src = chgImgArg[i + 1];
		}
	}
}


//::::Get image src
function getImgSrc(imgName,layName) {
	var srcVal;
	if (!!layName && document.layers) {
		srcVal = document.layers[layName].document.images[imgName].src;
	}
	else {
		srcVal = document.images[imgName].src;
	}
	if (srcVal.match(/:\/{2,3}[^\/]+(\/[^\\]+){2}/)) {
		return RegExp.$1;
	}
	else {
		return null;
	}
}


//::::Get image alt
function getImgAlt(imgName,layName) {
	var altVal;
	if (!!layName && document.layers) {
		altVal = document.layers[layName].document.images[imgName].alt;
	}
	else {
		altVal = document.images[imgName].alt;
	}
	return altVal;
}


//====_ Root-Sea, Inc. JavaScript Library _====//
/*-----------------------------------------------------
== Window Library == [2004/3/14]
2001-2004 (C) Root-Sea, Inc. All Rights Reserved.
Author:yoshihiro fujita
-----------------------------------------------------*/

//::::Window Open
var winOpen = new Array();
function windowOpen(uri, winName, w, h, which, stName) {
	var stVal0, stVal1;
	var setW = parseInt(w);
	var setH = parseInt(h);
	var winStatus, winSize, winValue;
	var wOpen;

// Set Status Value(1 or 0)
	if (which == 'disp') {
		stVal0 = 0;
		stVal1 = 1;
	}
	if (which == 'del') {
		stVal0 = 1;
		stVal1 = 0;
	}

// Set default Status Value
	var directoriesVal = stVal0;
	var statusVal = stVal0;
	var scrollbarsVal = stVal0;
	var toolbarVal = stVal0;
	var locationVal = stVal0;
	var menubarVal = stVal0;
	var resizableVal = stVal0;
	stName.indexOf('directories') != -1 ? directoriesVal = stVal0 : directoriesVal = stVal1;
	stName.indexOf('status') != -1 ? statusVal = stVal0 : statusVal = stVal1;
	stName.indexOf('scrollbars') != -1 ? scrollbarsVal = stVal0 : scrollbarsVal = stVal1;
	stName.indexOf('toolbar') != -1 ? toolbarVal = stVal0 : toolbarVal = stVal1;
	stName.indexOf('location') != -1 ? locationVal = stVal0 : locationVal = stVal1;
	stName.indexOf('menubar') != -1 ? menubarVal = stVal0 : menubarVal = stVal1;
	stName.indexOf('resizable') != -1 ? resizableVal = stVal0 : resizableVal = stVal1;
	winStatus =
		'directories=' + directoriesVal +
		',status=' + statusVal +
		',scrollbars=' + scrollbarsVal +
		',toolbar=' + toolbarVal +
		',location=' + locationVal +
		',menubar=' + menubarVal +
		',resizable=' + resizableVal;

// Window width & height adjust
	if (setW + setH > 0) {
		//Status : YES
		if (statusVal == 1) {
			//IE4 for Mac
			if (gMacC  && gIE4) {
				setH += 16;
			}
		}
		//Scroll : YES
		if (scrollbarsVal == 1) {
			//IE4 for Mac
			if (gMacC  && gIE4) {
				setW -= 1;
			}
			//NN4 for Mac
			if (gMacC && gNN4) {
				setW += 15;
			}
			//IE5 for Win
			else if (gWin && (gIE4 || gIE5 || gIE6)) {
				setW += 16;
			}
		}
		//Location : YES
		if (locationVal == 1) {
			//IE4 for Mac
			if (gMacC  && gIE4) {
				setH += 24;
			}
		}
		//Menu : YES
		if (menubarVal == 1) {
			//IE4 for Mac
			if (gWin && (gIE4 || gIE5 || gIE6)) {
				setH -= 19;
			}
		}
	}

	if (h != 0) {
		winSize = 'width=' + setW;
	}
	else if (w != 0) {
		winSize = 'height' + setH;
	}
	if (w != 0 && h != 0) {
		winSize = 'width=' + setW + ',height=' + setH;
	}
	if (setW + setH > 0) {
		winValue = winStatus + ',' + winSize;
	}
	else {
		winValue = winStatus;
	}
	winOpen[winName] = window.open(uri, winName, winValue);
}


//::::Get Window Open
function isOpener(targetWin) {
	var flag = 0;
	var ua = navigator.userAgent;
	if (!!targetWin) {
		if (ua.indexOf('Gecko') != -1 || ua.indexOf('MSIE 4') != -1 && ua.indexOf('Win') != -1) {
			if (!targetWin.closed) {
				flag = 1;
			}
			else {
				flag = 2;
			}
		}
		else {
			if (typeof targetWin.document  == 'object') {
				flag = 1;
			}
			else {
				flag = 2;
			}
		}
	}
	else {
		flag = 0;
	}
	return flag;
}


//::::Disp On Parent Window
function dispParentWin(uri) {
	if (isOpener(window.opener) == 1) {
		window.opener.location.href = uri;
	}
	else {
		windowOpen(uri, 'pWin', 0, 0, 'disp', '');
	}
}


//:::: Get window size
function getWinSize(which) {
	var re;
	if (document.layers || glNN6) {
		re = parseInt(eval("window.inner" + which));
		if (glNN6) {
			re -= 14;
		}
	}
	else {
		re = parseInt(eval("document.body.client" + which));
	}
	return re;
}


//:::: Get window offset
function getWinOffset(winName) {
	var winObj, t, w, offset;
	if (!winName) {
		winObj = window;
	}
	else {
		winObj = parent.frames[winName];
	}
	if (document.all) {
		w = winObj.document.body.scrollLeft;
		t = winObj.document.body.scrollTop;
	}
	else if (document.layers || document.getElementById) {
		w = winObj.pageXOffset;
		t = winObj.pageYOffset;
	}
	offset = w + "-" + t;
	return offset.split("-");
}


//::::Open Feature Window
function openFeatWin(uri) {
	windowOpen(uri, "dvcFeature", "750", "650", "del", "status, scrollbars, resizable");
}

//::::Open Language Menu Window
function openLangWin(uri) {
	windowOpen(uri, "dvcLanguageMenu", "760", "650", "del", "status, scrollbars, resizable");
}
