var params  = {
      scale: 'noScale',
      menu: 'false',
      allowFullScreen: 'true',
      allowScriptAccess: 'always',
      wmode: 'opaque',
	  bgcolor: '#ffffff',
      salign: ''                  
};

var attributes = {

  id: "flashreplace"
 
};

var flashwidthMin = 1024;
var flashheightMin = 600;

var api_url = "http://www.scoopnyc.com/gc_api.php";
var server_url = location.href;

if (server_url.indexOf("64.52.70.13") > 0)
	api_url = "http://64.52.70.13/scoop_micro/gc_api.php";
	
$(function () {        

	var flashvars = 
	{		
		xmlFile:"datasource.xml",
		key: "ABQIAAAAf7MyjM7inD7o6TxfSKs6GxTgSW18gvsqnv4IP1XuJSJzBiE5EBT36LwSLdHTQUg-N5zUOeWOzHFeWA"
	}
	
    swfobject.embedSWF("scoop_shell.swf","flashreplace",flashwidthMin,flashheightMin,"9.0.0","expressInstall.swf",flashvars,params, attributes);         
	swffit.fit("flashreplace",flashwidthMin,flashheightMin);
});
function call_gc_api(acct, call_type) {
    
    api_HCT = '';
    if (call_type == 'b')
        api_HCT = 0;
    else if (call_type == 'h')
        api_HCT = 999;

    var api_data = "ACT=" + acct + "&HCT=" + api_HCT;

    var html = $.ajax({
        type: "GET",
        url: api_url,
        data: api_data,
        dataType: "text",
        async: false
    }).responseText;
    return(html);
}

function getBalance(acct) {
    var api_data = "ACT=" + acct + "&HCT=0";

    var html = $.ajax({
        type: "GET",
        url: api_url,
        data: api_data,
        dataType: "text",
        async: false
    }).responseText;
	
	document.getElementById('flashreplace').sendToFlash(html);
   // return (html);
}

function getHistory(acct) {
    var api_data = "ACT=" + acct + "&HCT=999";

    var html = $.ajax({
        type: "GET",
        url: api_url,
        data: api_data,
        dataType: "text",
        async: false
    }).responseText;
	
	document.getElementById('flashreplace').sendToFlash(html);
}

function getBalance1(acct) {
    var api_data = "ACT=" + acct + "&HCT=0";

    var html = $.ajax({
        type: "GET",
        url: api_url,
        data: api_data,
        dataType: "text",
        async: false
    }).responseText;
	
	//document.getElementById('flashreplace').sendToFlash(html);
   return (html);
}

function getHistory1(acct) {
    var api_data = "ACT=" + acct + "&HCT=999";

    var html = $.ajax({
        type: "GET",
        url: api_url,
        data: api_data,
        dataType: "text",
        async: false
    }).responseText;
	
	//document.getElementById('flashreplace').sendToFlash(html);
	return (html);
}

 function tracker(value) {
 
	//alert(value);
	
	// tracking script...
 }