/*  ADD FAVORITE / BOOKMARK v1.0

	Tested with javascript: IE 6, 7 , 8.0 , 8.0 Comaptible , Firefox , Opera , Slimbrowser
    Without javascript: Firefox, Opera
      
	  by Argent

1. Add to <HEAD> this: <script src="add_to_favorites.js" ></script>
2. Add to <BODY> onload this: addFav('title','url','add_favorite_link_id'); 
			Example: <body onLoad="addFav('Google','http://www.google.com','add_to_favorite');">

3. Add/Modify link: <a id="add_to_favorite" href="#" rel="sidebar" title="Google" >Bookmark this site!</a>
/
///////////////////////////////////////////////*/

var href = window.location;
var title = document.title;
var GfavoriteID = '';

function addFavorite() {

  if(document.all) { // IE 7.0, 8.0, 8.0Compatible , Slimbrowser
    window.external.AddFavorite(href,title);
  }
  else {
    if(window.sidebar) { // Firefox, 
		document.getElementById(GfavoriteID).href = href;
		window.sidebar.addPanel(title,href,'');
		document.getElementById(GfavoriteID).href= 'javascript:addFavorite();';
    }
	else if(window.opera && window.print) { // Opera Hotlist
		document.getElementById(GfavoriteID).href = href;
		document.getElementById(GfavoriteID).rel = "sidebar";
	}
	else {
		alert('You need to press CTRL + D to bookmark our site.');
	}
	
  }
  
  
}
function addFav(newtitle,url,favoriteID) {
if(newtitle!="")
	title = newtitle;
if(url!="")
	href = url;

GfavoriteID = favoriteID;
document.getElementById(GfavoriteID).title = title;
document.getElementById(GfavoriteID).rel = 'sidebar';
if(window.opera && window.print) 
		document.getElementById(GfavoriteID).href = href;
else 
		document.getElementById(GfavoriteID).href= 'javascript:addFavorite();';

if(window.sidebar) 
		document.getElementById(GfavoriteID).rel = '';

if(!(window.opera && window.print))
		document.getElementById(GfavoriteID).title = '';
	

}

