$(document).ready(function()
{
defaultTextEnable();
});
function openVow() {
openBox('/search/vow');
if($('#body_container').length == 0) {
$('#popupBox').css('margin','50px 0 0 150px');
parent.window.scrollTo(0,250);
}
else {
window.scrollTo(0,0);
}
}
function openBox(url) {
var width = $(window).width();
var height = $(window).height();
$('#popupBox').html('
');
$('#body_overlay').css({ 'width':width+'px', 'height':height+'px' }).fadeIn();
$('#popupBox').fadeIn();
$('#popupBoxContent').load(url);
}
function closeBox() {
$('#popupBox').fadeOut();
$('#body_overlay').fadeOut();
}
function defaultTextEnable()
{
$('.defaulttext').click(function()
{
var val = $(this).val();
var title = $(this).attr('title');
if(val == title)
$(this).val('');
}).blur(function()
{
var val = $(this).val();
var title = $(this).attr('title');
if(val == '')
{
$(this).val(title);
$(this).addClass('defaulttext').removeClass('defaulttext_normal');
}
}).keydown(function()
{
$(this).addClass('defaulttext_normal').removeClass('defaulttext');
});
}
function number_format(a) {
var b = 0;
var c = '.';
var d = ',';
a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
e = a + '';
f = e.split('.');
if (!f[0]) {
f[0] = '0';
}
if (!f[1]) {
f[1] = '';
}
if (f[1].length < b) {
g = f[1];
for (i=f[1].length + 1; i <= b; i++) {
g += '0';
}
f[1] = g;
}
if(d != '' && f[0].length > 3) {
h = f[0];
f[0] = '';
for(j = 3; j < h.length; j+=3) {
i = h.slice(h.length - j, h.length - j + 3);
f[0] = d + i + f[0] + '';
}
j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
f[0] = j + f[0];
}
c = (b <= 0) ? '' : c;
return f[0] + c + f[1];
}
function makeTag(tagType,text,className,src)
{
var tmp=document.createElement(tagType);
if(typeof text != "undefined" && text !='')
if(tagType=='img')
tmp.alt=text;
else
tmp.appendChild(document.createTextNode(text));
if(typeof className != "undefined" && className !='')
tmp.className=className;
if(typeof src != "undefined")
{
if(tagType =='a') tmp.href=src;
if(tagType =='img') tmp.src=src;
}
return tmp;
}
function addListener(element, type, expression, bubbling)
{
bubbling = bubbling || false;
if(window.addEventListener)
{
element.addEventListener(type, expression, bubbling);
return true;
}
else if(window.attachEvent)
{ // IE
element.attachEvent('on' + type, expression);
return true;
} else return false;
}
function getElement(e)
{
return document.getElementById(e);
}
function frameHeight(frame)
{
var height = 0;
var f = window.frames[frame];
if(f.document.body.offsetHeight)
height = f.document.body.offsetHeight;
if(f.innerHeight)
height = f.innerHeight;
if(f.document.documentElement.clientHeight)
height = f.document.documentElement.clientHeight;
if(f.document.body.clientHeight)
height = f.document.body.clientHeight;
if(f.document.body.scrollHeight)
height = f.document.body.scrollHeight;
if(height) return height;
}
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i 0 && height > maxheight) var finalheight = maxheight;
else var finalheight = height;
//iframeEl.style.height = "auto";
iframeEl.style.height = finalheight + "px";
}
}
function swapLoginImgs()
{
setLayerDisp('menu_logout_div','inline');
setLayerDisp('menu_account_div','inline');
setLayerDisp('menu_email_div','none');
setLayerDisp('menu_login_div','none');
}
function getFrameLink(id,url)
{
if(id && url)
{
if(document.layers && document.layers[id].load)
document.layers[id].load(url,0);
else if(frames && frames.length && frames[id])
frames[id].location.replace(url);
else if(document.getElementById(id))
document.getElementById(id).location.replace(url);
}
}
function reloadFrame(id)
{
frames[id].location.reload(true);
}
function getValue(id)
{
if(document.getElementById(id)) return document.getElementById(id).value;
}
function setValue(id,val)
{
if(document.getElementById(id)) document.getElementById(id).value = val;
}
function setHTML(id,html)
{
if(document.getElementById(id)) document.getElementById(id).innerHTML = html;
}
function getResultCount(r,id)
{
setHTML('result'+r,'Loading...');
getFrameLink('dataframe','/search/resultcount?id='+id+'&r='+r);
}
function checkDefault(id,def,clk)
{
var val = document.getElementById(id).value;
if(clk && val && val == def) document.getElementById(id).value = '';
if(!clk && val == '') document.getElementById(id).value = def;
}
function swapImg(id,src)
{
document.images[id].src = src;
}
function unique(a)
{
tmp = new Array(0);
for(i = 0; i < a.length; i++)
{
if(!contains(tmp,a[i]))
{
tmp.length += 1;
tmp[tmp.length-1] = a[i];
}
}
return tmp;
}
function contains(a,e)
{
for(j = 0; j < a.length; j++)
if(a[j] == e) return true;
return false;
}
function getFrameSrc(id)
{
if(document.layers && document.layers[id].load)
return document.layers[id].location;
else if(frames && frames.length && frames[id])
return frames[id].location;
}
function getLeft(id)
{
xPos = document.getElementById(id).offsetLeft;
tempEl = document.getElementById(id).offsetParent;
while (tempEl != null)
{
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
return xPos;
}
function getTop(id)
{
yPos = document.getElementById(id).offsetTop;
tempEl = document.getElementById(id).offsetParent;
while (tempEl != null)
{
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
return yPos;
}
function getWidth(id)
{
var width = document.getElementById(id).offsetWidth;
if(!width) width = document.getElementById(id).style.width;
return width;
}
function getHeight(id)
{
var height = document.getElementById(id).offsetHeight;
if(!height) height = document.getElementById(id).style.height;
return height;
}
function windowWidth()
{
if (window.innerWidth)
{
if (document.body.offsetWidth)
{
if (window.innerWidth!=document.body.offsetWidth)
return document.body.offsetWidth;
}
return (window.innerWidth);
}
if (document.documentElement.clientWidth)
return document.documentElement.clientWidth;
if (document.body.clientWidth)
return document.body.clientWidth;
}
function windowHeight()
{
if (window.innerHeight)
{
if (document.body.offsetHeight)
{
if (window.innerHeight!=document.body.offsetHeight)
return document.body.offsetHeight;
}
return (window.innerHeight);
}
if (document.documentElement.clientHeight)
return document.documentElement.clientHeight;
if (document.body.clientHeight)
return document.body.clientHeight;
}
function getScrollPosition()
{
var scrOfX = 0, scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' )
{
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
}
else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
{
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
}
else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
{
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
return [scrOfX,scrOfY];
}
function setBlank(id)
{
document.getElementById(id).value='';
}
function setCookie(name,value,time)
{
if(!time) time = "Wed, 1 Jan 2020 12:00:00";
document.cookie = name+"="+value+"; expires="+time+" UTC"+"; path=/";
}
function setLayerVis(id,vis)
{
if(document.getElementById(id)) document.getElementById(id).style.visibility = vis;
}
function setLayerDisp(id,vis)
{
if(document.getElementById(id)) document.getElementById(id).style.display = vis;
}
function serviceArea()
{
window.open("service_areas.php","sa", "height=400, width=400, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no");
}
function listing_info(url,w,h)
{
window.open(url, "newWin", "height="+h+", width="+w+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
}
function openWindow(url,w,h)
{
window.open(url, "newWin", "height="+h+", width="+w+", toolbar=no, menubar=yes, scrollbars=yes, resizable=yes, location=no, directories=no, status=no");
}
function swapImgRestore()
{
var i,x,a=document.sr; for(i=0;a&&i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i