
/*
* The click event does not get passed to the container in Safari
* so our popup gets blocked. There is a workaraound in the flex
* script but we need to know if this is Safari.

*/

function checkBrowser() { var value = navigator.userAgent; return value; }

/*
* Create a sharelet that does not display a button,
* and will generate a popup on share.
*/

var ShareObj = SHARETHIS.addEntry({}, {button:false, popup:true});

/*
* Functions called from mx:Script to update elements
* in the sharelet.
*/

function ShareThis_set(el, val){
	ShareObj.properties[el] = val;
}

/*
* The share event executed from mx:Script.
*/

function ShareThis_share(){
	var browser = checkBrowser();
	if (browser.indexOf("Safari") > 1) {
	
	/*
	* Safari will take a moment to launch the new window.
	*/
		//alert("hi");
		var test = window.open("about:", "test", "width=1,height=1,status=0,toolbars=0,location=0,scrollbars=0");
		if(test){
			ShareObj.popup();
		}else{
			alert("Please make sure you have your popup blocker disabled.");
		}
	} else {
	
		ShareObj.popup();
		
	}
}
		

