// JAVASCRIPT COLLECTION BY Morten Grantzau
// Version 2.1
// ----------------------------------------------
// COPYRIGHT (C) 2001-2005 BY Morten Grantzau
// ALL RIGHTS RESERVED
// WWW.GRANTZAU.COM
// ----------------------------------------------

// NOTE: for this file to work insert into <BODY> tag like this: <body onload="removeBlur(), showDiv()">

// remove blur function - install note: insert into <BODY> onload="removeBlur()"
	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if (!document.getElementById) return
		links = document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = unblur
		}
	}
function removeBlur() {
			// removes the link boxes
			getLinksToBlur();
		}	
		
// PopUP window centered - install note: make href tag = javascript:popUp('your_page.html','popup',200,300,'scrollbars,resizable')
function popUp(file,name,width,height,parameters,align) {
	parameters += ',width='+width+',height='+height
	parameters += ',left='+(screen.availWidth - width)/2
	parameters += ',top='+(screen.availHeight - height)/2
	popup = window.open(file,name,parameters)
	popup.window.focus()
}		


// PRINT DOCUMENT - install note: make href tag = javascript:printit()
<!--

function printit(){
if (window.print) {
    window.print() ;
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";
}
}
//-->


// SHOW AND HIDE DIV - 	install note: Add "showDiv()" to onload.
//			Div parameters: <div id="blockDiv" STYLE="position:absolute; left:267px; top:20px; width:203px; height:17px;; visibility: hidden">content of div</div>
//			Link to show: <A HREF="javascript:showObject(block)">show</A>
//			Link to hide: <A HREF="javascript:hideObject(block)">hide</A>
<!--

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function showDiv() {
	if (ns4) block = document.blockDiv
	if (ie4) block = blockDiv.style
}

// Show/Hide functions for pointer objects

function showObject(obj) {
	if (ns4) obj.visibility = "show"
	else if (ie4) obj.visibility = "visible"
}

function hideObject(obj) {
	if (ns4) obj.visibility = "hide"
	else if (ie4) obj.visibility = "hidden"
}

//-->

// PRATE MODIFIED NOSPAM MAIL SCRIPT 	// javascript:killSpam('morten','grantzau.com')
	function killSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
	}


// Scroll function for SHOWCASE display (w:/deform/v9/)
	var place =0;
	// SCROLL TO FUNTIONS
	var pos =new Array(0, 990, 2000, 3150, 4200);
	function scrollit(v){ 
      var start=pos[place]; 
      var stop=pos[v]; 
	  if (start<stop) {
  	    while (start<=stop) {
	      //SCROLL RIGHT SPEED 
	      start =start+50;
	      top.MainFrame.scroll(Math.round(start),0);
	    }

	  } else if (start >=stop) {
		while (stop<=start) {
	      //SCROLL LEFT SPEED 
	      start =start-50;
	      top.MainFrame.scrollTo(Math.round(start),0);
	    }
	  }
      place =v;
}

// -----------------------------------------------------------------------------------

// SCROLL-IT FUNCTION START
	// <a href="javacript:scrollit(1)">link</a>

	var place =0;
	// SCROLL TO FUNTIONS
	var pos =new Array(0, 697, 1400, 2100, 2800);
	function scrollit(v){ 
      var start=pos[place]; 
      var stop=pos[v]; 
	  if (start<stop) {
  	    while (start<=stop) {
	      //SCROLL RIGHT SPEED 
	      start =start+10;
	      parent.caseFrame.scroll(Math.round(start),0);
	    }

	  } else if (start >=stop) {
		while (stop<=start) {
	      //SCROLL LEFT SPEED 
	      start =start-10;
	      parent.caseFrame.scrollTo(Math.round(start),0);
	    }
	  }
      place =v;
}                                      
// SCROLL-IT FUNCTION END

// -----------------------------------------------------------------------------------

// Disable load of pages in foreign framesets		// <BODY onload="javascript:pageloaded();">
function pageloaded(){
   var quirksMode = (top == self);
   if (!quirksMode){
        top.location.href = document.location;
        return;
     }
     which_background("");
     loaded = true;
} 

