// Krupp JavaScript
// Identity Developments
// Copyright 2005
////////////////////////

// Auto copyright
function copyright() {
var d=new Date();
yr=d.getFullYear();
if (yr!=2003)
	    document.write(" - "+yr+" ");
}


// image Popitup windows
// Based on JavaScript provided by Peter Curtis at www.pcurtis.com
// Routine for popup windows with title, size and background colour parameter (5 parameters)
// with mods by Identity Developments - www.i-devs.com

var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
	pwidth=iwidth+30;
	pheight=iheight+150;
	newwindow=window.open('','htmlname','width=' + pwidth +',height=' + pheight + ',resizable=1,top=50,left=10,status=1 ');
	wheight=iheight;
	wwidth=iwidth;
}
 
if (wheight!=iheight || wwidth!=iwidth ) {
	pwidth=iwidth+30;
	pheight=iheight+150;
	if (version.substring(0,1)>3) { 	// check browser v4+ supporting JavaScript 1.2	
		newwindow.resizeTo(pwidth, pheight);
	}
	wheight=iheight;
	wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">');
newwindow.document.writeln('<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">');
newwindow.document.writeln('<head> <title>' + title + '<\/title>');
newwindow.document.writeln('<meta http-equiv=\"imagetoolbar\" content=\"no\" \/>');
newwindow.document.writeln('<style type=\"text\/css\">');
newwindow.document.writeln('<!-- body {background: #000; margin-left: auto; margin-right: auto; color: #999; font: .8em\/1 verdana, arial, san-serif; text-align: center;} div.top {text-align: left} div.bottom {text-align: left; margin: 2px 0 4px 14px; font-size: 9px;} h1 {background-color: #007A8D; width: 157px; margin: 0 0 0 14px; padding: 30px 0 0; font-size: 38px; text-align: center; color: #FFF;} p {margin: 0 0 10px 22px; padding: 0; font-size: 10px;} a {color: #999; text-decoration: none;}-->');
newwindow.document.writeln('<\/style>');
newwindow.document.writeln('<\/head> <body>');
newwindow.document.writeln('<div class=\"top\"> <h1>KRUPP<\/h1> <p>GENERAL CONTRACTORS<\/p> <\/div>');
newwindow.document.writeln('<img src=\"' + url + '\" title=\"' + title + '\" alt=\"' + title + '\" \/>');
newwindow.document.writeln('<div class=\"bottom\">Copyright &copy;2005 Krupp General Contractors. All rights reserved.<\/div>');
newwindow.document.writeln('<a href=\"javascript:window.close();\">{Close window}<\/a> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

//Routine to tidy up popup windows when page is left
window.onunload = function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}


// Scroll to Anchors- by www.dreamlettes.net 
function ss_fixAllLinks() { 
 var allLinks = document.getElementsByTagName('a'); 
 for (var i=0;i<allLinks.length;i++) { 
   var lnk = allLinks[i]; 
   if ((lnk.href && lnk.href.indexOf('#') != -1) &&  
       ( (lnk.pathname == location.pathname) || 
   ('/'+lnk.pathname == location.pathname) ) &&  
       (lnk.search == location.search)) { 
     ss_addEvent(lnk,'click',smoothScroll); 
   } 
 }
} 
function smoothScroll(e) { 
 if (window.event) { 
   target = window.event.srcElement; 
 } else if (e) { 
   target = e.target; 
 } else return; 
 if (target.nodeType == 3) { 
   target = target.parentNode; 
 } 
 if (target.nodeName.toLowerCase() != 'a') return; 
 anchor = target.hash.substr(1); 
 var allLinks = document.getElementsByTagName('a'); 
 var destinationLink = null; 
 for (var i=0;i<allLinks.length;i++) { 
   var lnk = allLinks[i]; 
   if (lnk.name && (lnk.name == anchor)) { 
     destinationLink = lnk; 
     break; 
   } 
 } 
 if (!destinationLink) return true; 
 var destx = destinationLink.offsetLeft;  
 var desty = destinationLink.offsetTop; 
 var thisNode = destinationLink; 
 while (thisNode.offsetParent &&  
       (thisNode.offsetParent != document.body)) { 
   thisNode = thisNode.offsetParent;
   destx += thisNode.offsetLeft; 
   desty += thisNode.offsetTop; 
 } 
 clearInterval(ss_INTERVAL); 
 cypos = ss_getCurrentYPos(); 
 ss_stepsize = parseInt((desty-cypos)/ss_STEPS); 
 ss_INTERVAL = setInterval('ss_scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
 if (window.event) { 
   window.event.cancelBubble = true; 
   window.event.returnValue = false; 
 } 
 if (e && e.preventDefault && e.stopPropagation) { 
   e.preventDefault(); 
   e.stopPropagation(); 
 } 
} 
function ss_scrollWindow(scramount,dest,anchor) { 
 wascypos = ss_getCurrentYPos(); 
 isAbove = (wascypos < dest); 
 window.scrollTo(0,wascypos + scramount); 
 iscypos = ss_getCurrentYPos(); 
 isAboveNow = (iscypos < dest); 
 if ((isAbove != isAboveNow) || (wascypos == iscypos)) { 
   window.scrollTo(0,dest);
   clearInterval(ss_INTERVAL); 
   location.hash = anchor; 
 } 
} 
function ss_getCurrentYPos() { 
 if (document.body && document.body.scrollTop) 
   return document.body.scrollTop; 
 if (document.documentElement && document.documentElement.scrollTop) 
   return document.documentElement.scrollTop; 
 if (window.pageYOffset) 
   return window.pageYOffset; 
 return 0; 
}
function ss_addEvent(elm, evType, fn, useCapture) 
{ 
 if (elm.addEventListener){ 
   elm.addEventListener(evType, fn, useCapture); 
   return true;
 } else if (elm.attachEvent){ 
   var r = elm.attachEvent("on"+evType, fn); 
   return r; 
 } 
}
var ss_INTERVAL; 
var ss_STEPS = 25; 
ss_addEvent(window,"load",ss_fixAllLinks);

// Clear default form value script- By Ada Shimar (ada@chalktv.com)
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}


// SmartLink for directions popup window
function dpSmartLink(u,n,w,h,p) { // v1.4 by David Powers
  var a,j,k,x,y,f='';if(!n){n='';}if(w){f+='width='+w+',';}if(h){f+='height='+h+',';}
  if(p){p=p.split(':');if(p[0]!='z'){p[0]=='c'?(x=(screen.width-w)/2):x=p[0];f+='left='+x+',';}
  if(p[1]!='z'){if(p[0]=='c'){y=(screen.height-h-p[1])/2;if(navigator.appName.indexOf('Op')!=-1){
  y-=96;y=y<0?0:y;}}else{y=p[1];}f+='top='+y+',';}}a=arguments.length;if(a>5){for (k=5;k<a;k++){
  switch(arguments[k]){case 'all':f+='toolbar,menubar,location,scrollbars,status,resizable,';break;
  case 't':f+='toolbar,';break; case 'm':f+='menubar,';break;case 'l':f+='location,';break;
  case 'sc':f+='scrollbars,';break;case 's':f+='status,';break;case 'r':f+='resizable,';}}}
  if(f.charAt(f.length-1)==','){f=f.slice(0,-1);}j=window.open(u,n,f);j.focus();
  document.MM_returnValue=false;
}