﻿// JScript File

function makevisible(cur,which){
  if (which==0)
    cur.filters.alpha.opacity=100
  else
    cur.filters.alpha.opacity=60
}

function getTheBigPicture(img)
{
	var posX    = event.screenX;
	var posY    = event.screenY + 20;
	var screenW = screen.width;                                 // screen size
	var screenH = screen.height - 20;                           // take taskbar into account
	if (posX + 232 > screenW) { posX = posX - 232 - 40; }       // if mouse too far right
	if (posY + 164 > screenH) { posY = posY - 164 - 80; }       // if mouse too far down
	var wPosition   = 'dialogLeft:' -posX+ '; dialogTop:' -posY;
	var newcolor = showModalDialog('TheBigPicture.htm', img,'dialogWidth:401px; dialogHeight:564px; resizable=0; help=0; status=0; scroll=0; ' + wPosition);
}

function showTheBigPicture(img)
{
  var features;
  features='dialogWidth=401px, dialogHeight=564px, toolbar=no, status=no, resizable=no, help=no, menubar=no, location=no, scrollbars=no, scroll=0';
  features='dialogWidth:401px; dialogHeight:564px; resizable=0; help=0; status=0; scroll=0; ';
  newwin=window.showModalDialog('TheBigPicture.htm', img, features);
  if(newwin) {
    newwin.focus();
  }

  return newwin;
}

function roll_over(img_name, img_src)
{
    document[img_name].src = img_src;
}

function mOut(img_name)
{
    document[img_name].style.border = "1px solid white";
}

function mOver(img_name)
{
    document[img_name].style.border = "1px solid blue";
}

function getPicture()
{
    var img=window.dialogArguments;
    document.getElementById("imgBigPic").setAttribute("src",img);
}

function openWindow(URL,windowName,features,img) {
  var PathToStoreFront=null;
  if(openWindow.arguments.length>3) {
      PathToStoreFront=openWindow.arguments[3];
  }
  if(features=="PopUp") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="PopUpPrint") {
    features="width=790, height=580, toolbar=yes, status=no, resizable=yes, menubar=yes, location=no, scrollbars=yes";
  }
  if(features=="RTE" || windowName=="RTE") {
    features="width=800, height=600, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
  }
  if(features=="HelpWindow") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
    windowName="WWHFrame";
   }
  if(features=="StylePreview") {
    features="width=470, height=310, toolbar=no, status=no, resizable=no, menubar=no, location=no, scrollbars=no";
    windowName="StylePreview";
   }
  if(features=="DetailedImageView") {
    features="width=1000, height=730, toolbar=no, status=no, resizable=yes, menubar=no, location=no, scrollbars=yes";
    windowName="StylePreview";
   }
  if(features=="CheckLink") {
    if(URL.indexOf("?") != 0) {
      splittedString = URL.split('//');
      if(splittedString.length ==1){
        URL ="http://"+URL;
      }
    } else if(PathToStoreFront!=null){
        URL = PathToStoreFront+URL;
    }
    features="toolbar=yes, status=yes, resizable=yes, menubar=yes, location=yes, scrollbars=yes";
  }

  newwin=window.open(URL,windowName,features,img);
  if(newwin) {
    newwin.focus();
  }

  return newwin;
}
