﻿// JavaScript Document

function Browse(){
}

Browse.prototype={
	getVersion:function(){
		if(navigator.userAgent.indexOf("MSIE")>0)
			return "Internet Explorer";
		if(navigator.userAgent.indexOf("Firefox")>0)
			return "Firefox";
		if(navigator.userAgent.indexOf("Safari")>0)
			return "Safari";
		if(navigator.userAgent.indexOf("Camino")>0)
			return "Camino";
		if(navigator.userAgent.indexOf("Gecko")>0)
			return "Mozilla";
		return "unknown";
	},
	
	addFavorite:function(){
		if(arguments.length<1){
			alert("The method 'addFavorite' of browse occurs an exception.");
			return;
		}
		switch(this.getVersion()){
			case "Internet Explorer":
				window.external.addFavorite(arguments[0],arguments[1]);
				break;
			case "Firefox":
				window.sidebar.addPanel(arguments[1],arguments[0], "");
				break;
		}
	}
}
