﻿function ChangeClass(ele,cls) { ele.className = cls; }
function WriteReview(cmpId, cmpType) { window.open('http://www.movers.com/review.aspx?cid=' + cmpId + '&ct=' + cmpType, 'WriteReview', 'height=600,width=817,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 817) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function PopLogin() { window.open('http://www.movers.com/login.aspx', 'Login', 'height=600,width=817,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 817) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function PopMyAccount() { window.open('http://www.movers.com/myaccount.aspx', 'Login', 'height=600,width=817,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 817) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function PopRevwDet(cmpId, revwId, cmpType) { window.open('http://www.movers.com/reviewdetails.aspx?cid=' + cmpId + '&rId=' + revwId + '&ct=' + cmpType, 'ReviewDetails', 'height=600,width=817,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 817) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function showhide(obj) { var e, i = 0; while (e = document.getElementById('tabs').getElementsByTagName('DIV')[i++]) { if (e.className == 'on' || e.className == 'off') { e.className = 'off'; var mdiv = e.getAttribute('title'); document.getElementById(mdiv).className = "hide"; } } obj.className = 'on'; var max = obj.getAttribute('title'); document.getElementById(max).className = "show"; }
function showText(ctrl, txtDiv, xpos, ypos) { var displayRegion = document.getElementById(txtDiv); var hoverRegion = ctrl; var newX = findPosX(hoverRegion); var newy = findPosY(hoverRegion); newX = newX + xpos; newy = newy + ypos; var lft = newX + 'px'; var tp = newy + 'px'; displayRegion.style.display = ""; displayRegion.style.position = "absolute"; displayRegion.style.left = lft; displayRegion.style.top = tp; }
function hideText(ctrl, txtDiv) { var displayRegion = document.getElementById(txtDiv); displayRegion.style.display = "none"; }
function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent; } } else if (obj.x) { curleft += obj.x; } return curleft; }
function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) { curtop += obj.y; } return curtop; }
function ShowPhNo() { if (document.getElementById('phnum').style.display == 'none') { document.getElementById('phnum').style.display = ''; document.getElementById('imgCNo').src = '/images/fmc/minus.gif'; } else { document.getElementById('phnum').style.display = 'none'; document.getElementById('imgCNo').src = '/images/fmc/plus.gif'; } }
function MoverReq(cmpId) { window.open('http://www.movers.com/mover-request.aspx?id=' + cmpId, 'movreq', 'height=400,width=550,top=' + ((screen.height) ? (screen.height - 400) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 550) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function WhyJoin() { window.open('http://www.movers.com/why-join-us.aspx', 'whyjoin', 'height=520,width=600,top=' + ((screen.height) ? (screen.height - 520) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 600) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
function CouponEP(type, id, cname) { window.open('http://www.movers.com/couponemailprint.aspx?type=' + type + '&id=' + id + '&cn=' + cname, "couponemailprint", 'height=550,width=770,scrollbars=yes,top=' + ((screen.height) ? (screen.height - 550) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 770) / 2 : 0)); }
function ShareThis() { window.open('http://wd.sharethis.com/share4x/index.f44917094a14a09de1329d8bb11b8ab8.html#popup/publisher=34ca7032-d45c-4553-9119-4854b7f72e03/type=website/popup=true/embeds=true/style=rotate/post_services=twitter%2Cfacebook%2Cmyspace%2Cdigg%2Cstumbleupon%2Cdelicious%2Cgoogle_bmarks%2Creddit%2Clinkedin%2Cwindows_live%2Cemail%2Csms%2Cbebo%2Cybuzz%2Cblogger%2Cyahoo_bmarks%2Cmixx%2Ctechnorati%2Cfriendfeed%2Cpropeller%2Cwordpress%2Cnewsvine%2Cxanga/sessionID=' + (new Date()).getTime().toString() + "." + Number(Math.random().toPrecision(5).toString().substr(2)).toString() + '/pUrl=' + encodeURIComponent(encodeURIComponent(document.location.href)) + '#popup/title=' + encodeURIComponent(encodeURIComponent(encodeURIComponent(document.title))) + '/url=' + encodeURIComponent(encodeURIComponent(document.location.href)) + '/publisher=34ca7032-d45c-4553-9119-4854b7f72e03/sessionID=' + (new Date()).getTime().toString() + "." + Number(Math.random().toPrecision(5).toString().substr(2)).toString() + '/toolbar=true', 'ShareThis', 'height=450,width=345,top=' + ((screen.height) ? (screen.height - 450) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 345) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
// Privacy Policy Popup
function PPolicy() { window.open('/privacy-policy.aspx', 'privacypolicy', 'height=500,width=800,top=' + ((screen.height) ? (screen.height - 500) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 800) / 2 : 0) + ',scrollbars=yes'); }
// Coupon Details Popup
function CouponDet(cpnId) { window.open('http://www.movers.com/couponAC.aspx?cpnId=' + cpnId, 'coupon', 'height=400,width=500,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 817) / 2 : 0) + ',scrollbars=no,resizable=no'); }
// Function to show photos in div
function ShowImg(imgDiv, imgName, imgUrl) { var img = new Image(); img.onload = function () { var imgWidth, imgHeight; if (img.width > 950) { imgWidth = 950; } else { imgWidth = img.width; } if (img.height > 500) { imgHeight = 500; } else { imgHeight = img.height; } var imageDiv = document.getElementById(imgDiv); var divHtml = '<table border="0" cellspacing="0" cellpadding="0" width="' + (imgWidth + 30) + '" style="border:outset 4px #333333;background-color:#016aa1;"><tr><td align="right" height="30"><a href="javascript:CloseDiv(\'' + imgDiv + '\');" style="text-decoration:none;"><font face="Arial" color="#ffffff" size="1"><b>Close (X)</b></font></a>&nbsp;&nbsp;</td></tr><tr><td align="center"><img src="' + imgUrl + '" width="' + imgWidth + '" height="' + imgHeight + '" /></td></tr><tr><td height="30" align="center"><font face="Arial" color="#ffffff" size="2"><b>' + imgName + '</b></font></td></tr></table>'; imageDiv.innerHTML = divHtml; ShowDiv(imgDiv, imgWidth + 30, imgHeight + 60, 'center'); }; img.src = 'http://www.movers.com' + imgUrl; }
// Displays a given div tag at the given position.
function ShowDiv(divId, top, left, pos) { var divCtrl = document.getElementById(divId); divCtrl.style.position = "absolute"; if (pos == 'center') { var point = window.center({ width: top, height: left }); divCtrl.style.top = point.y + "px"; divCtrl.style.left = point.x + "px"; } else { divCtrl.style.top = top + 'px'; divCtrl.style.left = left + 'px'; } divCtrl.style.display = ''; }
// Hides a video div tag and removes all the html code inside the div tag.
function CloseDiv(vidDiv) { document.getElementById(vidDiv).style.display = 'none'; document.getElementById(vidDiv).innerHTML = ''; }
// Returns the size of the browser window based on the browser and its mode.
window.size = function () { var w = 0; var h = 0; if (!window.innerWidth) { if (!(document.documentElement.clientWidth == 0)) { w = document.documentElement.clientWidth; h = document.documentElement.clientHeight; } else { w = document.body.clientWidth; h = document.body.clientHeight; } } else { w = window.innerWidth; h = window.innerHeight; } return { width: w, height: h }; }
// Returns top & left position required to center a div tag in a browser window.
window.center = function () { var hWnd = (arguments[0] != null) ? arguments[0] : { width: 0, height: 0 }; var _x = 0; var _y = 0; var offsetX = 0; var offsetY = 0; if (!window.pageYOffset) { if (!(document.documentElement.scrollTop == 0)) { offsetY = document.documentElement.scrollTop; offsetX = document.documentElement.scrollLeft; } else { offsetY = document.body.scrollTop; offsetX = document.body.scrollLeft; } } else { offsetX = window.pageXOffset; offsetY = window.pageYOffset; } _x = ((this.size().width - hWnd.width) / 2) + offsetX; _y = ((this.size().height - hWnd.height) / 2) + offsetY; return { x: _x, y: _y }; }
function showZip(objFrm, txtZip) { window.open('/includes/scripts/zipCodes.asp?frm=' + objFrm + '&txtZip=' + txtZip, 'ZipCodes', 'height=400,width=586,top=' + ((screen.height) ? (screen.height - 270) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 630) / 2 : 0) + ',scrollbars=yes'); }
function AllRvws(cId, type, cnm) { window.open('/reviews.aspx?cid=' + cId + '&ctp=' + type + '&cnm=' + cnm, 'Reviews', 'height=600,width=800,top=' + ((screen.height) ? (screen.height - 600) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 800) / 2 : 0) + ',scrollbars=yes,resizable=no'); }
var hideTimer;
function showMSeal(ctrl, txtDiv, xpos, ypos) {clearTimeout(hideTimer);  var displayRegion = document.getElementById(txtDiv); var hoverRegion = ctrl; var newX = findPosX(hoverRegion); var newy = findPosY(hoverRegion); newX = newX + xpos; newy = newy + ypos; var lft = newX + 'px'; var tp = newy + 'px'; displayRegion.style.display = ""; displayRegion.style.position = "absolute"; displayRegion.style.left = lft; displayRegion.style.top = tp; }
function hideMSeal() { hideTimer = setTimeout("hideDiv()", 1000); }
function hideDiv() { document.getElementById('divMSeal').style.display = 'none'; }
