﻿function DWS() {}

DWS.showEnquireForm = function(url, title, width, height)
{
    if (title == null)
        title = "Enquire Form";
    
    if (width == null)
        width = 600;
    
    if (height == null)
        height = 500;
        
    var windowOptions = "width=" + width + ",height=" + height + ",scrollbars=yes,toolbar=no,resizable=no";
    
    return window.open(url, title, windowOptions, true);
}

DWS.openPopUp = function(url, title, width, height)
{
    if (title == null)
        title = "Form";
    
    if (width == null)
        width = 600;
    
    if (height == null)
        height = 500;
        
    title = title.replace(/\/|\-|\./gi, "");   
    var whitespace = new RegExp("\\s","g");   
    title = title.replace(whitespace,"");         
        
    var windowOptions = "width=" + width + ",height=" + height + ",scrollbars=yes,toolbar=no,resizable=no";
       
    window.open(url, title, windowOptions, true);
}


DWS.openPopUpStatusBar = function(url, title, width, height)
{
    if (title == null)
        title = "Form";
    
    if (width == null)
        width = 600;
    
    if (height == null)
        height = 500;
        
    title = title.replace(/\/|\-|\./gi, "");   
    var whitespace = new RegExp("\\s","g");   
    title = title.replace(whitespace,"");         
        
    var windowOptions = "width=" + width + ",height=" + height + ",scrollbars=yes,toolbar=no,resizable=yes,status=1";
       
    window.open(url, title, windowOptions, true);
}





DWS.openPDFPopUp = function(url, title, width, height)
{
    if (title == null)
        title = "PDF";
    
    if (width == null)
        width = 600;
    
    if (height == null)
        height = 500;
        
    title = title.replace(/\/|\-|\./gi, "");   
    var whitespace = new RegExp("\\s","g");   
    title = title.replace(whitespace,"");         
        
    var windowOptions = "width=" + width + ",height=" + height + ",scrollbars=yes,toolbar=no,resizable=yes";
       
    window.open(url, title, windowOptions, true);
}

DWS.openCustomPopUp = function(url, title, attributes)
{
    if (title == null)
        title = "Form";
    
    if (attributes == null)
        attributes = 'width=600,height=500,scrollbars=yes,toolbar=no,resizable=no';

    title = title.replace(/\/|\-|\./gi, "");   
    var whitespace = new RegExp("\\s","g");   
    title = title.replace(whitespace,"");         
        
    window.open(url, title, attributes, true);
}

DWS.printPage = function()
{
	if(window.print) window.print();
}

DWS.closePage = function ()
{
	window.close();
}


DWS.doHover = function(obj)
{
    obj.style.backgroundColor = '#999';
}

DWS.undoHover = function (obj)
{
    obj.style.backgroundColor = '';
}

DWS.doRoll = function(obj)
{
    obj.style.opacity = '1';
    obj.style.filter = 'alpha(opacity=100)';
}

DWS.doUnRoll = function(obj)
{
    obj.style.opacity = '0.80';
    obj.style.filter = 'alpha(opacity=80)';
}

function doNothing() {}
