// Open Pop-Up Window
function openWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// Set Form Function

function CV_setForm() {
  
	var doc = document.forms['search'];
	var price_min = doc.price_min.value; 
  
	if (price_min=="") {
	doc.price_max.value = '';
	return;
	}
  
	if (price_min=="0") {
  	doc.price_max.value = '15';
	}
  
	if (price_min=="15") {
	doc.price_max.value= '30';
	}
  
	if (price_min=="30") {
	doc.price_max.value = '50';
	}
  
	if (price_min=="50") {
	doc.price_max.value = '100';
	}
  
	if (price_min=="100") {
	doc.price_max.value = '';
	} 

}

// Get current domain
var thisDomain = "";
thisDomain = document.domain;

//<![CDATA[
function bookmark(anchor){
   if(window.external)
   {
       window.external.AddFavorite(anchor.getAttribute('href'), anchor.getAttribute('title'));
       return false;
   }
   return true;
}
//]]>


// Browser Detect

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
        browser = "Konqueror";
        OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
        browser = "Netscape Navigator"
        version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
        if (checkIt('linux')) OS = "Linux";
        else if (checkIt('x11')) OS = "Unix";
        else if (checkIt('mac')) OS = "Mac"
        else if (checkIt('win')) OS = "Windows"
        else OS = "an unknown operating system";
}

function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function bookmarksite(title, url) {
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
	}

function addBookmark(title,url) { 
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) { 
		window.external.AddFavorite( url, title); 
		} else if( window.opera && window.print ) { 
		return true; 
		} 
	}

/***********************************************
set class on input buttons to get rid of borders on ie
***********************************************/

function setClass(){
	var theinputs = document.getElementsByTagName("input");
	var i;
	for(i = 0; i < theinputs.length; i++)
	{
		if(theinputs[i].type == "radio" || theinputs[i].type == "checkbox")
		{
			theinputs[i].className = 'radio';
		}
		if(theinputs[i].type == "text" || theinputs[i].type == "password")
		{
			theinputs[i].className = 'text';
		}
		if(theinputs[i].type == "submit" || theinputs[i].type == "reset")
		{
			theinputs[i].className = 'submit';
		}
	}
}
