/**
 * site_functions_quote.js - JavaScript Functions.
 * @package site_functions_quote.js
 * @copyright 2005 - 2008 OSD
 * Functions for quote module
*/

function ToggleMenuBkgd(id) {
	var nodeObj = document.getElementById(id);
	var nodeBackground = nodeObj.style.background;

	if (nodeBackground.indexOf('orange.gif') != -1) {
		nodeObj.style.background = "url('img/white.gif')";
	}
	else {
		nodeObj.style.background = "url('img/orange.gif')";
	}
}

function AddFavourites() {
	var NSstring = "<a href='javascript:alert(&#34;Click [Ctrl + D] to Add Bestquote.ie to your favourites\n\n\n\n\n&#34;);' title='[Ctrl + D] - Add Bestquote.ie to favourites'><img src='img/addtofavs.jpg' border='0' alt='Add Bestquote.ie to favourites'><\/a><br>";
	var OPstring = "<a href='javascript:alert(&#34;Click [Ctrl + T] to Add Bestquote.ie to your favourites&#34;);' title='[Ctrl + T] - Add Bestquote.ie to favourites'><img src='img/addtofavs.jpg' border='0' alt='Add Bestquote.ie to favourites'><\/a>";
	var IEstring = "<a href='javascript:window.external.addfavorite(\"http://www.bestquote.ie\",\"Bestquote Ireland - A network of over 20 different insurance companies.\");'><img src='img/addtofavs.jpg' border='0' alt='Add Bestquote.ie to favourites'><\/a>";

	var OTHstring = "Bookmark Bestquote.ie?";
	var whichString = OTHstring;
	var agt = navigator.userAgent.toLowerCase();
	var app = navigator.appName.toLowerCase();
	var ieAgent = agt.indexOf('msie');
	var nsAgent = app.indexOf('netscape');
	var opAgent = app.indexOf('opera');
	if (ieAgent!= -1) { whichString = IEstring; } else if (nsAgent!= -1){ whichString = NSstring; } else if (opAgent!= -1) {whichString = OPstring; }
	document.write(whichString);
}

var on_color = "#002C6B";
var off_color = "#FFFFFF";
var blink_onoff = 1;
var blinkspeed= 500;
function blink() { 
	if( blink_onoff == 1) { 
       motor_nodeObj.style.color = on_color;
       house_nodeObj.style.color = on_color;
       travel_nodeObj.style.color = on_color;
	   blink_onoff = 0;
	}
	else { 
	   motor_nodeObj.style.color = off_color;
       house_nodeObj.style.color = off_color;
       travel_nodeObj.style.color = off_color;
	   blink_onoff = 1;
	}
}

function popUp(URL, height, width, scroll, resize) { 
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + scroll + ",location=0,statusbar=0,menubar=0,resizable=" + resize + ",width=" + width + ",height=" + height + ",left = 10,top = 10');");
}

// onload="default_excess();"
function default_excess() { 
    //alert('here');
    var excess;
    excess = document.getElementById('ddlAddCoverVoluntaryExcess');
    //alert("excess Index : "+excess.selectedIndex+"\n\nexcess value : "+excess.options[excess.selectedIndex].value);
    //alert("Current excess value : "+excess.options[excess.selectedIndex].value+" Euro");
    excess.selectedIndex = 3;
    //alert("excess Index : "+excess.selectedIndex+"\n\nexcess value : "+excess.options[excess.selectedIndex].value);
    //alert("Updated excess value : "+excess.options[excess.selectedIndex].value+" Euro");
}
