
var langCode = '*';
var regiCode = '*';
var DcvCover = '1';
var DcvColor = '0';
var col_border = '111111';
var col_bg = '111111';
var col_view = '111111';
var col_link = 'F0F0D0';
var col_url = 'FFFFCC';
var col_text = 'B0B090';

function chkParent (pPage, pName) {
return;
if (pName == null) pName = pPage; 
document.write('<br><br><center><p>You are now looking at a partial display of our <b>' + pName + ' </b>section<br>'); 
document.write('Click on the icon below to view the full ' + pName + ' section at our digital camera and photography website<br><a href="/' + pPage + '.htm"><img border="0" src="/artlib/dcv_black.gif" alt="DCViews for digital camera news, views and reviews" width="96" height="48"></a><br>Copyright 2000-2006 AAA-Views</center><br><br>');
}

function openBrWindow(theURL,winName,features) { //v3.0
 NewWindow = window.open(theURL,winName,features);
 NewWindow.focus();
}

function FixHeight() {
return;
}

function SetDiv(divId,n) {
var x,y;
if (n == 1) x = 382;
else if (n == 2) x = 482;
else if (n == 3) x = 250;
else if (n == 4) x = 116;
if (window.innerHeight) y = window.innerHeight - x;
else if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientHeight != 0) y = document.documentElement.clientHeight - x;
else if (document.body) y = document.body.clientHeight - x;
if (y < 96) y = 96;
document.write('<div class="' + divId + '" style="height: ' + y + 'px;">');
}

function BanDiv() {
var x;
if (window.innerWidth) x = window.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth != 0) x = document.documentElement.clientWidth;
else if (document.body) x = document.body.clientWidth;
x = x - 114;
if (x >= 728) document.write('<div style="text-align:center; width:728px; height:90px;">');
else document.write('<div style="position:absolute; top:3px; left:114px; width:' + x + 'px; height:90px;">');
}

function EndDiv() {
document.write('</div>');
}

function WinWidth() {
if (window.innerWidth) return(window.innerWidth);
else if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth != 0) return(document.documentElement.clientWidth);
else if (document.body) return(document.body.clientWidth);
else return 0;
}

function InitSession() {
SetCookie('session',1,0);
if (document.referrer.indexOf("aaa-views") > -1 ) SetCookie('referrer',1,0);
startup = GetCookie('startup');
if (startup == 1) bestfitWin();
if (startup == 2) maximizeWin();
if (startup == 4) setmyWindow();
var Today =  new Date();
var TimeNow = Math.round(Today.getTime() / 1000);
SetCookie('banid',2,0);
SetCookie('bantm',TimeNow,0);
SetCookie('banid1',0,0);
SetCookie('banid2',0,0);
SetCookie('banid3',0,0);
}

function InitPage (init, frame) {
var color = 0;
if (init != null) {
   if (frame == null) color = init;
   if (frame != null) addPage (init, frame);
   else if (GetCookie('session') == null) InitSession();
   }
var lCookie = GetCookie('language');
if (lCookie == null || lCookie == "") langCode = '*';
else langCode = lCookie;
regiCode = myCountry();
regiCode = regiCode.substr(0,2);
var vCookie = GetCover (color);
DcvCover = vCookie.substr(0,1);
DcvColor = vCookie.substr(1,1);
GetColor = vCookie;
BanColor(DcvCover,DcvColor);
document.write('<link rel="stylesheet" type="text/css" href="/cover-' + DcvCover + '.css">');
document.write('<link rel="stylesheet" type="text/css" href="/color-' + DcvColor + '.css">');
}

function addPage (init, frame) {
if (typeof(parent.view) != "undefined") return;
if (window.location.href.indexOf("file:") > -1 ) return;
if (init == 1) top.location.href = "/news-v.htm?" + frame;
if (init == 2) top.location.href = "/news-s.htm?" + frame;
if (init == 3) top.location.href = "/tutors-t.htm?" + frame;
return;
}

function GetCover (color) {
var vCookie = GetCookie('cover');
if (vCookie == null || vCookie == "") vCookie = "10";
if (vCookie != "00" && vCookie != "31" && vCookie != "50" && vCookie != "61" && vCookie !="71" && vCookie !="82" && vCookie !="99") vCookie = "10";
if (Browser('Type') == 'N' && Browser('Version').substr(0,1) < '5') return vCookie;
if (vCookie.substr(1,1) >= "1") return vCookie;
if (GetCookie('newspage') == 1) return vCookie;
if (color != 0 && Browser('Platform') == 'M')  vCookie = "61";
if (color != 0 && Browser('Platform') != 'M')  vCookie = "82";
return vCookie;
}

function InitLang() {
if (langCode=="*") return;
var alltags=document.all? document.all : document.getElementsByTagName("*");
for (i=0; i<alltags.length; i++){
    if (alltags[i].className=="nLang") {
       if (langCode=="0" || langCode=="2") alltags[i].style.display='none';}
    if (alltags[i].className=="sLang") {
       if (langCode=="0" || langCode=="1") alltags[i].style.display='none';}
  }
}

function bestfitWin() {
if (document.layers) return;
  if (window.screen) {
    var mw = 1004;
    var mx = 0;
    if (document.layers) {
    var mw = 800;
    var mx = 100;
    }2
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    if (ah > 992) ah = 992;
    if (aw >= mw) {
      window.moveTo((aw-mw)/2, 0);
      window.resizeTo(mw, ah - mx);
    }
    if (aw < mw) {
      maximizeWin();
    }
  }
}

function maximizeWin() {
if (document.layers) return;
  if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    window.moveTo(0, 0);
    window.resizeTo(aw, ah);
  }
}

function setmyWindow() {
window.moveTo(GetCookie('winleft'), GetCookie('wintop'));
window.resizeTo(GetCookie('winwidth'), GetCookie('winheight'));
}

function InitStyle () {
if (GetCookie('session') == null && typeof(parent.view) != "undefined") InitSession();
var SysType = "p";
if (Browser('Platform') == 'M') SysType = "m";
var BrwType = "x";
if (Browser('Type') == 'M') BrwType = "e";
if (Browser('Type') == 'N') BrwType = "n";
if (Browser('Version') > '5') BrwType = "e";
SetStyle(SysType,BrwType);
var vCookie = GetCookie('language');
if (vCookie == null || vCookie == "") langCode = '*';
else langCode = vCookie;
regiCode = myCountry();
regiCode = regiCode.substr(0,2);
}

function SetStyle (SysType, BrwType) {
var Cover = GetCookie('cover');
if (Cover == null) cType = "*";
else cType = Cover.substr(1,1);
if (BrwType == "e") {
if (cType > "5" || Cover == "61" || Cover == "71") document.write('<link rel="stylesheet" type="text/css" href="/style_w.css">');
else document.write('<link rel="stylesheet" type="text/css" href="/style_e.css">');
}
else {
if (cType > "5" || Cover == "61" || Cover == "71") document.write('<link rel="stylesheet" type="text/css" href="/style_x.css">');
else document.write('<link rel="stylesheet" type="text/css" href="/style_n.css">');
}
}

function InitCover () {
var SysType = "p";
if (Browser('Platform') == 'M') SysType = "m";
var BrwType = "x";
if (Browser('Type') == 'M') BrwType = "e";
if (Browser('Type') == 'N') BrwType = "n";
SetCover(SysType,BrwType);
}

function SetCover (SysType, BrwType) {
var Cover = GetCookie('cover');
if (Cover == null) {
Cover = "00";
if (SysType == "p" && BrwType == "e") Cover = "21";
else if (SysType == "m" && BrwType == "e") Cover = "81";
else if (BrwType == "n" && Browser('Version').substr(0,1) > '4')  Cover = "21";
}
if (SysType == "m" && BrwType == "e" && (Browser('Version') < '5.0')) Cover = "03";
document.write('<link rel="stylesheet" type="text/css" href="/cover' + Cover + '.css">');
}

function InitBanner (bid) {
var bReg = "10";
var mReg = myCountry().substr(0,2);
if (mReg == "02") bReg = "02";
if (mReg == "03") bReg = "03";
if (mReg == "11") bReg = "11";
document.write('<scr' + 'ipt type="text/javascript" src="/banners/ban' + bid + bReg + '.js"></scr' + 'ipt>');
}

function SetBanners () { 
if (typeof(parent.ban1) != "undefined") parent.ban1.location.href="/ban1.htm";
if (typeof(parent.ban2) != "undefined" && ChkBanner(2) != 0) parent.ban2.location.href="/ban2.htm";
else if (typeof(parent.ban3) != "undefined" && ChkBanner(3) != 0) parent.ban3.location.href="/ban3.htm";
if (top.location.href.indexOf("/dcvtest.htm") == -1) return;
if (GetCookie('session') == null) return;
if (self.location.href.indexOf("/news/ns") == -1) return;
if (typeof(parent.side) != "undefined" && self.name == "view") parent.side.location.href="/ban0.htm";
if (typeof(parent.view) != "undefined" && self.name == "side") parent.view.location.href="/ban0.htm";
}

function ChkBanner (bid) {
var BanId = GetCookie('banid');
var BanTm = GetCookie('bantm');
var Today = new Date();
var msec = Today.getMilliseconds(); 
if (BanId == null || BanTm == null) return (msec %4);
var TimeNow = Math.round(Today.getTime() / 1000);
var TimeLap = TimeNow - BanTm; 
if (TimeLap > 1 && BanId == bid) return parseInt(GetCookie('banid' + bid));
return 0;
}

function NewBanner (bid, bcnt) {
var Today = new Date();
var msec = Today.getMilliseconds();
var BanId = GetCookie('banid');
var BanTm = GetCookie('bantm');
if (BanId == null || BanTm == null) return (msec %bcnt) + 1;
BanId = parseInt(BanId) + 1;
if (BanId > 3) BanId = 1;
SetCookie('banid',BanId,0);
var TimeNow = Math.round(Today.getTime() / 1000);
SetCookie('bantm',TimeNow,0);
var bnr = (GetCookie('banid' + bid));
var nxtBanner = parseInt(bnr) + 1;
if (nxtBanner > bcnt) nxtBanner = 1;
SetCookie('banid' + bid,nxtBanner,0);
return bnr;
}

function LoadBan5() {
var x = mb_top.offsetTop;
var y = mb_end.offsetTop;
if (y-x < 64 && typeof(self.ban5) != "undefined") self.ban5.location.replace("/ban5.htm?cam");
if (y-x < 64 && typeof(parent.ban5) != "undefined") parent.ban5.location.replace("/ban5.htm?cam");
if (y-x >= 64 && typeof(parent.ban5) != "undefined") parent.ban5.location.replace("/ban5.htm");
}

function BanColor (Cover,Color) {
if (Color == "0") {
col_border = '111111';
col_bg ='111111';
col_view = '111111';
col_link = 'F0F0D0';
col_url = 'FFFFCC';
col_text = 'B0B090';}
if (Color == "1" && Cover == "6") {
col_border = 'DDDDDD';
col_bg = 'DDDDDD';
col_view = 'FFFFFF';
col_link = '000088';
col_url = 'AAAAAA';
col_text = '000099';}
if (Color == "2" || Cover >= "7") {
col_border = 'FFF5E5';
col_bg = 'FFF5E5';
col_view = 'FFFFFF';
col_link = 'B46A1F';
col_url = 'AAAAAA';
col_text = 'FF9900';}
}

function xItem (iHtml,iparm) { 
ilang = iparm.substr(0,1);
iregi = iparm.substr(0,2);
if (langCode == "*") ilang = "*";
if (ilang != "*" && ilang != langCode) return;
if (iparm.substr(1,1) == " ") iregi = "*";
if (iregi != "*" && iregi != regiCode) return;
document.write(iHtml);
}

function xMenuItem (iHtml,iparm) { 
ilang = iparm.substr(2,1);
iregi = iparm.substr(2,2);
if (langCode == "*") ilang = "*";
if (ilang != "*" && ilang != langCode) return;
if (iparm.substr(3,1) == " ") iregi = "*";
if (iregi != "*" && iregi != regiCode) return;
document.write(iHtml);
}

function xMi (imenu,iitem,isub,idate,itext,iurl,iparm) { 
if (iparm.substr(4,6) > dcvDate()) return;
iload = xIl(iparm.substr(0,1));
iicon = xIi(iparm.substr(1,1));
ilang = iparm.substr(2,1);
iregi = iparm.substr(2,2);
if (langCode == "*") ilang = "*";
if (ilang != "*" && ilang != langCode) return;
if (iparm.substr(3,1) == " ") iregi = "*";
if (iregi != "*" && iregi != regiCode) return;
if (isub == 0) {
xHtml = '<tr><td height="14" class="menumain">';
if (idate != "*") xHtml = xHtml + idate + '&nbsp;';
xHtml = xHtml + '</td><td width="100%" class="menumain"><a href="' + iurl + '" target="' + iload + '">' + itext + '</a></td><td align="right" class="menumain"><a href="' + iurl + '" target="' + iload + '">';
if (iicon != 0) xHtml = xHtml + '<img border="0" src="' + iicon + '.gif" alt="">';
else xHtml = xHtml + '&nbsp;';
xHtml = xHtml + '</a></td></tr><tr><td height="2"></td></tr>';
document.write(xHtml);
return;
}
if (isub == -1) {
  xHtml = '<tr>' + '<td width="100%" class="menumain">' + itext + '</td><td align="right" class="menumain"><img border="0" src="/artlib/bg_blnk.gif" alt=""></td></tr><tr><td height="2"></td></tr>';
  document.write(xHtml);
  }
  else {
  xHtml = '<tr>' + '<td width="100%" class="menumain"><a href="' + iurl + '" target="' + iload + '">&nbsp;&nbsp;' + itext + '</a></td><td align="right" class="menumain"><a href="' + iurl + '" target="' + iload + '"><img border="0" src="' + iicon + '.gif" alt=""></a></td></tr><tr><td height="2"></td></tr>';
  document.write(xHtml);
  }
}

function xIl (iload) {
if (iload == 4) return "view";
if (iload == 5) return "side";
if (iload == 6) return "main";
if (iload == 7) return "_self";
if (iload == 8) return "_blank";
}

function xIi (iicon) {
if (iicon == 0) return "/artlib/bg_blnk";
if (iicon == 1) return "/artlib/bg_link";
if (iicon == 2) return "/artlib/bg_lnks";
if (iicon == 3) return "/artlib/bg_subs";
if (iicon == 4) return "/artlib/bg_mail";
if (iicon == 5) return "/artlib/bg_ssd";
if (iicon == 9) return "/artlib/bg_link";
}

function MenuOpen (imenu,iitem) {
SetCookie('M_' + imenu,iitem,0);
if (imenu > 4) window.location.assign('side.htm');
if (imenu <= 4) window.location.assign('frm' + imenu +'.htm');
}

function dcvDate() {
var dcv = new Date();
var dcvd = dcv.getDate();
if (dcvd < 10) dcvd = "0" + dcvd;
var dcvdn = dcv.getDay();
var dcvdm = dcv.getMonth() + 1;
if (dcvdm < 10) dcvdm = "0" + dcvdm;
var dcvdy = dcv.getYear() + "";
if (dcvdy.substr(0,1) == 1) dcvdy = "20" + dcvdy.substr(1,2);
return dcvdy.substr(2,2) + "" + dcvdm + "" + dcvd;
}
function myCountry () {  
var mCtry = GetCookie('country');
if (mCtry != null) return mCtry;
mCtry = navigator.language;
if (Browser('Type') == 'M') mCtry = navigator.userLanguage;
if (mCtry == "undefined" || mCtry == "") return "100us";
ln = mCtry.substr(0,2);
co = mCtry.substr(3,2);
ln = ln.toLowerCase();
co = co.toLowerCase();
if (ln == "en" && co == "us") return "100us";
if (ln == "en" && co == "gb") return "020uk";
if (ln == "en" && co == "ie") return "021ie";
if (ln == "en" && co == "au") return "500au";
if (ln == "en" && co == "ca") return "110ca";
if (ln == "fr" && co == "be") return "051be";
if (ln == "fr" && co == "ca") return "111ca";
if (ln == "fr" && co == "ch") return "051ch";
if (ln == "fr" && co == "") return "050fr";
if (ln == "de" && co == "at") return "041at";
if (ln == "de" && co == "ch") return "041ch";
if (ln == "de" && co == "") return "040de";
if (ln == "es" && co == "mx") return "120mx";
if (ln == "es" && co == "") return "060es";
if (ln == "pt" && co == "br") return "130br";
if (ln == "pt" && co == "") return "061pt";
if (ln == "nl" && co == "be") return "031be";
if (ln == "nl" && co == "") return "030nl";
if (ln == "da" && co == "") return "011dk";
if (ln == "fi" && co == "") return "011fi";
if (ln == "el" && co == "") return "071gr";
if (ln == "it" && co == "") return "070it";
if (ln == "no" && co == "") return "011no";
if (ln == "sv" && co == "fi") return "011fi";
if (ln == "sv" && co == "") return "010se";
return "100us";
}

function myLanguage () {  
var vCookie = GetCookie('language');
if (vCookie != null) return vCookie;
return "*";
}

var popupHandle;
var popupTop;
var popupLeft;

function popUp(url, id) {
if (id == null) id = 2;

if (url == "b"){
url = id;
id = 2;
}

if (id == 0) {
var width = 266;
var height = 288;
}
if (id == 1) {
var width = 360;
var height = 270;
}
else if (id == 2){
var width = 520;
var height = 390;
}
else if (id == 3){
var width = 680;
var height = 550;
}
id = "view" + id;
var winx = (window.screen.width-width)/2;
var winy = (window.screen.height-height)/2;
var prop = 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+ width +',height='+ height +',left='+ winx +',top='+ winy;
popDown();
popupHandle = open(url,id,prop);
}

function popDown() {
if(popupHandle != null && !popupHandle.closed) popupHandle.close();
}

function iBbOld () { 
return;
}

function iBcOld () { 
return;
}

function iBx (bUrl,bRegion,bAff,bAlt) { 
return;
var regionCode = myCountry().substr(0,2);
if (bRegion == "") bRegion = "10";
if (bUrl != "" && bRegion == regionCode) {
  document.write('<a href="' + bUrl + '" title="' + bAlt + '" target="_blank"><img border="0" src="/artlib/buttons/' + bAff + "_" + bRegion + '.gif" alt="' + bAlt + '" align="center"></a>');
  SetCookie('iBx',1,0);
  }
else if (bRegion == "10") {
  if (GetCookie('iBx') != 1) {
     document.write('<a href="' + bUrl + '" title="' + bAlt + '" target="_blank"><img border="0" src="/artlib/buttons/' + bAff + "_" + bRegion + '.gif" alt="' + bAlt + '" align="center"></a>');
     }
  }
}

function iBs (sHdr,sUrl,sRegion) { 
if (GetCookie('referrer') == 1) return;
var regionCode = myCountry().substr(0,2);
if (sRegion == "") sRegion = "10";
if (sUrl != "" && sRegion == regionCode) {
  document.write('</td></tr><tr><td class="back" colspan="3"><scr' + 'ipt type="text/javascript" src="' + sUrl + '"></scr' + 'ipt>'); SetCookie('iBs',1,0); return;
  }
if (regionCode == "11" && sUrl != "" && sRegion == "10") {
  document.write('</td></tr><tr><td class="back" colspan="3"><scr' + 'ipt type="text/javascript" src="' + sUrl + '"></scr' + 'ipt>'); SetCookie('iBs',1,0); return;
  }
}

function iB9 () { 
if (GetCookie('iBs') != 1) {
  document.write('</td></tr><tr><td class="back" align="center" colspan="3"><iframe name="ban9" src="/ban9.htm" width="250" height="150" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>'); SetCookie('iBs',1,0);
  }
}

function fPrint (frm) { 
if (Browser('Type') == 'O')
   alert("Sorry, your browser doesn't support this feature.");
else
   window.print();
}

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}

function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1) endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie (name, value) {  
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (356*24*60*60*1000));
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
if (argv[2] == null) var expires = expdate; 
else if (argv[2] != 0) var expires = argv[2];
var path = (argc > 3) ? argv[3] : "/";  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}

function DelCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function Browser(bParm) {
if (bParm == 'Platform') {
return navigator.platform.substr(0,1);
}
if (bParm == 'Type') {
var useragent = navigator.userAgent;
return (useragent.indexOf('Opera') > -1) ? 'O' : navigator.appName.substr(0,1);
}
if (bParm == 'Id') {
var useragent = navigator.userAgent;
return (useragent.indexOf('Opera') > -1) ? 'O' : navigator.platform.substr(0,1) + navigator.appName.substr(0,1);
}
if (bParm == 'Version') {
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
bVer = useragent.substr(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substr(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1)	{
bVer = useragent.substr(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substr(0, pos);
}
if (bName == "Netscape") {
var bVer = useragent.substr(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substr(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substr(pos + 1);
}
if (bVer.substr(0,1) < "4") {
var pos = useragent.indexOf('/5.');
if (pos > -1) var bVer = useragent.substr(pos + 1,3);
}
return bVer;
}
}