header_footer_version=1;
if(typeof spac_version == 'undefined') {
document.write('<'+'script type="text/javascript" src="http://img.as.sanook.com/scripts/spac.js"><'+'/script>');
}
function parseUri(sourceUri){
	var uriPartNames = ["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"],
	uriParts = new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(sourceUri),
	uri = {};
	
	for(var i = 0; i < 10; i++){
		uri[uriPartNames[i]] = (uriParts[i] ? uriParts[i] : "");
	}
		
	/* Always end directoryPath with a trailing backslash if a path was present in the source URI
	Note that a trailing backslash is NOT automatically inserted within or appended to the "path" key */
	if(uri.directoryPath.length > 0){
		uri.directoryPath = uri.directoryPath.replace(/\/?$/, "/");
	}
		
	return uri;
}

function addbookmark() {
	bookmarkurl=window.location.href;
	bookmarktitle=document.title;

	if (window.external) {
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
	} else {
		msg = "Your browser does not support this feature.  If you are using Netscape Navigator\n";
		msg = msg + "Click \"Bookmarks\" and then \"Add Bookmark\"  or type \"Ctrl+D\" to add this site to your favorites.";
		alert(msg);
	}
}

function mail2friend(email) {
	//window.open('http://58.181.242.18/global/mail2friend/mail2friend.php?url=' + window.location.href + '&email1=' + email, 'mail2friend', 'width=557,height=360,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
	window.open('http://app.sanook.com/mail?' + window.location.href, 'mail2friend', 'width=557,height=360,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
}
