﻿
if (document.images) {
    image1 = new Image
	image2 = new Image
	image1.src = 'images/estimate.gif'
	image2.src = 'images/estimate2.gif'

    image3 = new Image
    image4 = new Image
    image3.src = 'images/check.gif'
    image4.src = 'images/check2.gif'

    image5 = new Image
    image6 = new Image
    image5.src = 'images/mwish.gif'
    image6.src = 'images/mwish2.gif'

}

function hideshow(id) {
    var obj = document.getElementById(id);
    if (obj.style.visibility == "visible") {
        obj.style.display = "none";
        obj.style.visibility = "hidden";
    }
    else {
        obj.style.display = "inline";
        obj.style.visibility = "visible";
    }
}


//thumbnail pop-ups
var popbackground = "#000000" //specify backcolor or background image for pop window
var windowtitle = "Dominion Power Washing | Gallery"  //pop window title

function detectexist(obj) {
    return (typeof obj != "undefined")
}

function popimage(imgpath, popwidth, popheight, popres, textdescription) {

    function getpos() {
        leftpos = (detectexist(window.screenLeft)) + 50
        toppos = (detectexist(window.screenTop)) + 50 
        if (window.opera) {
            leftpos -= screenLeft
            toppos -= screenTop
        }
    }

    getpos()
        var winattributes='width='+popwidth+',height='+popheight+',location=no, menubar=no, status=no, toolbar=no ,scrollbars=yes,left='+leftpos+',top='+toppos
        var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
        if (typeof jkpopwin=="undefined" || jkpopwin.closed)
        jkpopwin=window.open("","",winattributes)
        else{
        getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
        jkpopwin.moveTo(leftpos, toppos)
        jkpopwin.resizeTo(popwidth, popheight+30)
        }
        jkpopwin.document.open()
        jkpopwin.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+'><center><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br />'+textdescription+'</center></body></html>')
        jkpopwin.document.close()
        jkpopwin.focus()
        }

function wclose() {
    window.close()
}


// request form check

function chkfrm() {

    var nm = document.reqfrm.name.value
    if (nm == "") {
        alert("Please enter your name")
        document.reqfrm.name.focus()
        return;
    }
    var cm = document.reqfrm.phone.value
    if (cm == "") {
        alert("Please enter your phone Number")
        document.reqfrm.phone.focus()
        return;
    }
    
   document.reqfrm.submit()
}

// Reset Form
function resetfrm() {
    document.reqfrm.reset()
    document.reqfrm.name.focus()
}

//Gallery Movie Pop-up Window

function gpopup(wname) { 
    window.open(wname, 'movie', 'toolbars=no,scrollbars=no,width=550,height=450')
}

function wclose() {
    window.close() 
	 }







