﻿// JScript File
var defHeader = "<html><head><title>Print Module</title><link rel=stylesheet type=text/css href=SSPath /></head><body>";
var defFooter = "<div style=Blue_Print_Footer>Printed on: " + Date().toString() + "</div></body></html>";
function ChangeItemsPerPage(count)
{
    alert("Count = "+count)
}
function IDX_ViewDetails(ctrlID,mlsID)
{
    //alert("ctrlID = " + ctrlID + " , mlsID = " + mlsID)
    document.getElementById("dnn_ctr"+ctrlID+"_ViewSWFHomes_hfDetailID").value=mlsID
    //setTimeout("__doPostBack('" + "dnn$ctr" + ctrlID + "$ViewSWFHomes$hfDetailID" + "\',\'\')', 0)
    //setTimeout("__doPostBack(\'dnn$ctr" + ctrlID + "$ViewSWFHomes$hfDetailID\',\'\')", 0)
}
function VidTabSelect(tab,count)
{
    document.getElementById("ViewerTab01").className="Blue_Detail_Viewer_Tabs_Cell"
    document.getElementById("ViewerTab02").className="Blue_Detail_Viewer_Tabs_Cell"
    tab.className="Blue_Detail_Viewer_Tabs_Cell_Selected"
    if (tab.id=="ViewerTab01")
    {
        document.getElementById("ViewerImages").style.visibility="visible"
        document.getElementById("ViewerVids").style.visibility="hidden"
        document.getElementById("VIDEO").controls.stop();
    }
    if (tab.id=="ViewerTab02")
    {
        document.getElementById("ViewerImages").style.visibility="hidden"
        document.getElementById("ViewerVids").style.visibility="visible"
        document.getElementById("VIDEO").controls.play();
    }
}
function popup(url, name, width, height, resizable)
{ 
	var popwin;
	var opts="toolbar=no,status=no,location=no,menubar=no,scrollbars=yes";
	opts += ",height=" + height + ",width=" + width + ",resizable=" + resizable;
	popwin = window.open("", name, opts);
	     popwin.focus();
	popwin.location = url;
	popwin.opener = self; 
}
function printModule(Header, Body, Footer, AutoPrint, SSPath)
{

    var PrintWin = window.open("","PrintWindow","height=550,width=750,toolbar=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,modal=yes");
    var htmlHeader = defHeader.replace("SSPath", SSPath);
    var htmlFooter=defFooter;
    var re =/<SPAN class=Blue_Listing_Agency.*?<\/SPAN>/gim;
    Body = Body.replace(re,'');
    var os = htmlHeader + Header + Body + Footer + htmlFooter;
    PrintWin.offscreenBuffering=true;
    PrintWin.document.open();
    PrintWin.document.write(os);
    PrintWin.document.close();
    PrintWin.location.reload();
    if (AutoPrint) {
        PrintWin.print();}
}
function addEvent2(elm, evType, fn, useCapture)
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
} 
function pausecomp(millis) 
{
    var date = new Date();
    var curDate = null;

    do { curDate = new Date(); } 
    while(curDate-date < millis);
}
function removeEvent2(elm, evType, fn, useCapture)
{
  if (elm.removeEventListener){
    elm.removeEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.detachEvent){
    var r = elm.detachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
}
function addLoadEvent(func) 
{  
    var oldonload = window.onload;  
    if (typeof window.onload!= 'function') 
    {  
        window.onload = func;  
    }  
    else {  
        window.onload = function() {  
        oldonload();  
        func();  
        }  
    } 
} 
function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, false);
		return true;
	}
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else
	{
		alert("Handler could not be attached");
	}
}
function _initIDX()
{
    if (document.getElementById("ViewerImages"))
    {
        window.setTimeout("SlideShowStart()", 3000);
        //window.setTimeout("alert('setTimeout Text')", 5000);
    }
}
