//VARIOUS **
function init() {
MM_preloadImages(
'/i/nav/home_store_over.gif',
'/i/nav/glass_buildings_over.gif',
'/i/nav/kitchens_over.gif',
'/i/nav/hardware_over.gif',
'/i/nav/ml_over.gif',
'/i/nav/divider_over.gif'
);
window.onresize = handle_resize;
// if appropriate show menu
if (page_section_global) {
switch(page_section_global) {
case 104:
case 1033:
case 1151:
menuId = 'glass_buildings_menu';
break;
case 105:
case 1071:
case 1189:
menuId = 'hardware_menu';
break;
case 106:
case 1096:
case 1214:
menuId = 'ml_menu';
break;
case 1000:
menuId = 'garden_room_store_menu';
break;
default:
// alert('error initialising unknown menu ' + page_section_global);
return;
}
menu = document.getElementById(menuId);
revealMenu(menu);
}
}
var selected_thumbnail = 1;
function do_gallery_mouseover(id) {
if (id != selected_thumbnail) {
var thumb = document.getElementById('thumbnail_' + id);
thumb.className='transOff';
}
}
function do_gallery_mouseout(id) {
if (id != selected_thumbnail) {
var thumb = document.getElementById('thumbnail_' + id);
thumb.className='transOn';
}
}
function show_gallery_image(id) {
// reset class for selected thumbnail
document.getElementById('thumbnail_' + selected_thumbnail).className='transOn';
// set class for this thumbnail
document.getElementById('thumbnail_' + id).className='transOff';
selected_thumbnail = id;
// set description text
document.getElementById('description').innerHTML = descriptions[id];
// set main image iframe src
// document.getElementById('gallery_main_image_iframe').src = '/gallery_image.php?page_id=' + page_id_global + '&image_id=' + id;
// change image src in iframe
if (zoomify_exists[id] == 1) {
change_iframe_zoomify(id);
} else {
change_iframe_image(id);
}
}
function change_iframe_zoomify(id) {
document.getElementById('gallery_main_image_iframe').src = '/gallery_image.php?page_id=' + page_id_global + '&image_id=' + id;
}
function launch_aspect_ratio_calculator() {
var calcWin = openSpecialWin('/aspect_ratio_calculator','Calculator',400,400,'no');
calcWin.focus();
}
function launchLanternRoofSpecifier(region) {
if (region == 'US') {
sPicURL = 'http://www.lanternroofs.com/us/application.html';
} else {
sPicURL = 'http://www.lanternroofs.com/application.html';
}
var w = 1022;
var h = 718;
var winl = (screen.width - w) / 2;
var wint = ((screen.height - h) / 2) -20;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'scrollbars=0,resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0'
window.open(sPicURL, "", winprops)
}
var popupWidth = 500;
var popupHeight = 400;
function launch_popup(id) {
getPopupSize(id);
var popupWin = openSpecialWin('/popup?id='+id, 'Foo', popupWidth, popupHeight, 1);
popupWin.focus();
}
function getPopupSize(id) {
var queryString = 'id=' + id;
jQuery.ajax({
type: "POST",
async: false,
dataType: "html",
url: "/ajax_get_popup_size.php",
data: queryString,
// error: function(requestObject, errorString, execptionObject) {
// display_ajax_error(requestObject, errorString, execptionObject);
// },
success: function(msg){
// alert(msg);
var bits = msg.split(':');
if (bits[1] > 0) {
popupWidth = bits[1];
} else {
popupWidth = 500;
}
if (bits[2] > 0) {
popupHeight = bits[2];
} else {
popupHeight = 400;
}
}
});
}
function display_ajax_error(requestObject, errorString, execptionObject) {
alert("ajax requestObject:\n" + requestObject.type);
alert("ajax errorString:\n" + errorString);
alert("ajax execptionObject:\n" + execptionObject);
}
function brochure_request() {
var region = arguments[0];
var selected_brochure = arguments[1];
var newWin = openSpecialWin('/request_a_brochure?region=' + region + '&selected_brochure=' + selected_brochure, '', 505, 560, 1);
newWin.focus();
}
function change_iframe_image(id) {
var oIframe = document.getElementById("gallery_main_image_iframe");
var oDoc = oIframe.contentWindow || oIframe.contentDocument;
if (oDoc.document) {
oDoc = oDoc.document;
}
var mainImage = oDoc.getElementById('main_image');
if (mainImage) {
// currently showing an ordinary image
mainImage.src = '/i/gallery_images/' + page_id_global + '_main_' + id + '.jpg';
} else {
// currently showing a zoomify image
var small_image_div = oDoc.getElementById('small_image');
small_image_div.innerHTML = "
";
}
}
function handle_resize() {
if (menu) {
revealMenu(menu);
return true;
}
}
function openSpecialWin(url,name,w,h,scroll) {
if (!scroll) {
scroll = 'no';
}
popup=window.open(url,name,'width='+w+',height='+h+',toolbar=no,location=no,status=no,scrollbars=' + scroll + ',resizable=no')
return popup;
}
function clearDefaultText(theText) {
if (theText.value == theText.defaultValue) {
theText.value = ""
}
}
function do_paint_sample_mouseover(ord, spec, name) {
var swatch = document.getElementById('color_sample_table_cell_' + ord);
if (swatch) {
swatch.style.borderColor = 'white';
swatch.className='swatchTransOn';
}
preview.style.backgroundColor = '#' + spec;
preview_name.innerHTML = name;
}
function do_paint_sample_mouseout(ord, spec) {
var swatch = document.getElementById('color_sample_table_cell_' + ord);
if (swatch) {
swatch.style.borderColor = '#' + spec;
swatch.className='swatchTransOff';
}
preview.style.backgroundColor = '#EDF1F4';
preview_name.innerHTML = ' ';
}
function noop() {
;
}
//Define global variables
var timerID = null;
var timerOn = false;
var timecount = 1000;
var what = null;
var newbrowser = true;
var check = false;
//DREAMWEAVER**
function MM_setTextOfLayer(objName,x,newText) {
if ((obj=MM_findObj(objName))!=null) with (obj)
if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
else innerHTML = unescape(newText);
}
function MM_showHideLayers() {
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_displayStatusMsg(msgStr) {
status=msgStr;
document.MM_returnValue = true;
}
function MM_reloadPage(init) {
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_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