/*******************************************************************************
Author : Roger D. Hosto Jr.
Version : Version 1.0 - Oct 3, 2006
*******************************************************************************
Notes :
*******************************************************************************
The code display in the usage area should be placed in the body of the HTML 
document at the end of the page.
*******************************************************************************
Usage :
*******************************************************************************
<script type="text/javascript" src="http://www.x10.com/javascripts/bookmarks.js"></script>
<input type="button" value="Save This Page!" onclick="bookmark('http://www.x10.com/minisites/worldsbestwebcam/ppc/compare_logitech.html','X10 Video Calling System','Save Me For later')">
<a href="javascript:bookmark('http://www.x10.com/minisites/worldsbestwebcam/ppc/compare_logitech.html','X10 Video Calling System','Save Me For later');">bookmark</a>
*******************************************************************************/
/*
 * ONLY EDIT ANYTHING BELOW HERE IF YOU TRUELY KNOW WHAT YOU ARE DOING
 */
function bookmark( url, title, text ){
	var CookieStr = document.cookie;
	var CookieSt = CookieStr.split( ';' );
	var StSize = CookieSt.length;
	for ( x = 0; ( x < StSize ); x++ ){
		CookiePces = CookieSt[x].split( '=' );
		var key = CookiePces[0].replace( /^\s/, "");
		// Make the remove the leading white space
		if( key == "x_10c1")
			var value = unescape( CookiePces[1] );
	}
	var gif=(document.location.protocol=="https:")?"https://track.x10.com/pixelbm.gif":"http://track.x10.com/pixelbm.gif";
	var date = new Date();
	var m=new Image(1,1);			
	m.src=gif+"?text="+escape(text)+"&x_10c1="+value+"&RND="+date.getTime();
	m.onload=function() { return null; }
	setBookmark( url, title );
}
function setBookmark( url, title ) {
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		window.external.AddFavorite(url,title);
	} else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");
	} else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	}
}
