/*
'---------------------------------------------------------------------------------
' Purpose:  Global JavaScript File for Website
' File:     main.[someversionnumber].js
' System:   leaselistings.com
' Who               When            What                                          
' Jay Niemeyer	    18 Oct 2005    	Coded Main File
'---------------------------------------------------------------------------------
*/
//frame bustout disabled until loaded
//if (parent.frames.length > 0) top.location.replace(document.location);
// remove undesireables
function rem_obj(obj){
	obj.value = obj.value.replace(/'/g, "");
	obj.value = obj.value.replace(/"/g, "");
	obj.value = obj.value.replace(/;/g, "");
	obj.value = obj.value.replace(/</g, "");
	obj.value = obj.value.replace(/>/g, "");
}
// used to confirm links before popping a window open
function confirmlink(x){
	var x;
	if (confirm('Are you sure you wish to report this link?')){
		NewWindow(x,'Detail','308','200','no','center');
	}
}
// throws popup window
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// used in the scan results page to show or hide what driver the user clicks on.		
/*
function showScanResults(el) {
	var obj = document.getElementById(el); 	
	if(obj.style.display=="none"){
		obj.style.display="";
	}else if(obj.style.display==""){
		obj.style.display="none";			
	}
	
}
*/
// Copyright 2004 Bontrager Connection, LLC

//used to write text to an element
function writeObj(objName, theContent) {
	if (document.getElementById) {
		document.getElementById(objName).innerHTML = theContent
	}
	else if (document.all) {
		document.all(objName).innerHTML = theContent
	}
	else if (document.layers) {
		document.layers[objName].document.write(theContent)
		document.layers[objName].document.close()
	}
}
function showObj(objName) {
	if (document.getElementById) {
		document.getElementById(objName).style.display = "";
	}
	else if (document.all) {
		document.all(objName).style.display = "";
	}
}
function sendDriverDetectiveComment(el,ProdName){
	var x;
	x = eval('document.form.Comment'+ el +'.value');
	if(confirm("Are you sure you wish to send this contact submission?")){
		if (x==""){
			alert("You must enter a comment.");
			eval('document.form.Comment'+ el +'.focus');
		}
		else{
			document.form.ProblemDriver.value = ProdName;
			document.form.ProblemID.value = el;
			document.form.submit();
		}
	}
}
function redirector(el){
	document.location.href = el;
}
function ReloadIt(){
	if(confirm("You must reload the page before the changes will take effect. Do you want to reload now?")){
        this.document.location.href = this.document.location.href;
	}
}
