<!--
var topurl;
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
var note = "";
var noteFor = "";
var viewportwidth;
var viewportheight;

var sAlbCode = top.sAlbCode;
var iImgCount = 0;
//var sLabelList = "";
var sPath = "";
var sOrList = "";
var sAlbTitle = "";
var sThumbnails = "";
var sCustomGreeting = "";
var sGuestBookLink = "";
var bIsCD = false;
var orArray;
var topurl;
var iCurrImg;
var iTotImages;
var sConnSpeed;
var labelArray = new Array();
var fullViewLoaded = false;

var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

	function computeDimension()
	{
	  // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	 
	  if (typeof window.innerWidth != 'undefined')
	  {
		viewportwidth = window.innerWidth,
		viewportheight = window.innerHeight
	  }
	 
	  // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	
	  else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	  {
		 viewportwidth = document.documentElement.clientWidth,
		 viewportheight = document.documentElement.clientHeight
	  }
	 
	  // older versions of IE
	 
	  else
	  {
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
		viewportheight = document.getElementsByTagName('body')[0].clientHeight
	  }
	
	  //alert("width: " + viewportwidth + "height: " + viewportheight);
	}

  function parseDelimit(inVal,type)
  {
    var remStr = inVal;
    if (inVal.charAt(inVal.length - 1) != "|")
    {
      remStr = inVal + "|";
    }
    var sepCount = 0;
    for (i=0;i < remStr.length;i++)
    {
      if (remStr.charAt(i) == "|")
      {
        sepCount++;
      }
    }
    
    if (type == "L")
    {
      labelArray = new Array(sepCount);
    }
    else
    {
      orArray = new Array(sepCount);
    }
    var remTemp = "";
    var thisStr = "";
    for (cnt = 0;cnt < sepCount;cnt++)
    {
      for (i=0;i < remStr.length;i++)
      {           
        if (remStr.charAt(i) != "|")
        {
          thisStr = thisStr + remStr.charAt(i);
        }
        else
        {
          if (type == "L")
          {
            labelArray[cnt] = thisStr;
          }
          else
          {
            orArray[cnt] = thisStr;
          }
          for (j=i + 1;j < remStr.length;j++)
          {
            remTemp = remTemp + remStr.charAt(j);
          }
          remStr = remTemp;
          remTemp = "";
          thisStr = "";
          break;
        }
      }
    }
  }

  function openColorbox(icUrl)
  {
	computeDimension();
	var aw = viewportwidth - 50;
	var ah = viewportheight;
	if (aw > 1200)
	{
		aw = 1200;
	}
	if (ah > 850)
	{
		ah = 850;
	}
	
	$.fn.colorbox({href: icUrl,
								 iframe: true,
								 width: aw,
								 height: ah,
								 innerWidth: aw,
								 innerHeight: ah,
								 scrolling: false
								 });
  }
  
  function loadConfig()
  {
    parseDelimit(sLabelList,"L");
	$('div.scthumbcontrol').magicalHover({speedView:200,speedRemove:400,altAnim:false,speedTitle:400,debug:false});
  }
  
  function openFullview(inCurrImg,inTotImages,insPath,insAlbCode)
  {
    sPath = insPath;
    sAlbCode = insAlbCode;
    iCurrImg = inCurrImg;
    iTotImages = inTotImages;
    openColorbox("fview.html");	  
  }
  
  function openSlideShow(inTotImages,insPath,insAlbCode)
  {
    sPath = insPath;
    sAlbCode = insAlbCode;
    iTotImages = inTotImages;
    openColorbox("sshow.html");	  
  }
  
  function openFeedback()
  {
    openColorbox("http://www.subhadipsas.com/tinc?key=VkBjeDPy");	  
  }
  

function openMaxSizeWindow(url, spec, windowframe)
{
  var str;
  var win;
	  
  str = spec;

  if (window.screen) 
  {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var height = ah - 150;
    var width = aw - 30;

    str += ",height=" + height + ",innerHeight=" + height;
	
    str += ",width=" + width + ",innerWidth=" + width;

    var xc = (aw - width) / 2;
    var yc = (ah - height - 110) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;	
  }
  topurl = url;
  win = window.open(windowframe, "_blank", str);
  return win;
}

function openSizedWindow(url, spec, windowframe, width, height) 
{
  var str;
  var win;
	  
  str = spec;
	  
  if (window.screen) 
  {
    var ah = screen.availHeight;
    var aw = screen.availWidth;

    str += ",height=" + height + ",innerHeight=" + height;
	
    str += ",width=" + width + ",innerWidth=" + width;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;	
  }
  topurl = url;
  win = window.open(windowframe, "_blank", str);
  return win;
}

function openFullScreenWindow(url, spec, windowframe)
{
  var str;
  var win;
	  
  str = spec;

  if (window.screen) 
  {
    var height = screen.availHeight - 35;
    var width = screen.availWidth - 10;

    str += ",height=" + height + ",innerHeight=" + height;
	
    str += ",width=" + width + ",innerWidth=" + width;

    var xc = 0;
    var yc = 0;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;	
  }
  str += ",scrollbars=1";
  topurl = url;
  win = window.open(url, "_blank", str);
}

function isInteger(s)
{
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function isDate(dtStr)
{
	//alert(dtStr);
	var daysInMonth = DaysArray(12)
	//alert(daysInMonth);
	var pos1=dtStr.indexOf(dtCh)
	//alert(pos1);
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	//alert(pos2);
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

// -->
