//Gets browser width and height properties

$.getCoords = function(){
    if (window.innerHeight || window.innerWidth) {
        return {
            w: window.innerWidth,
            h: window.innerHeight
        }
    }
    return {
        w: document.documentElement.clientWidth,
        h: document.documentElement.clientHeight
    }
};

//-----------[Settings of resized window]-----------//

var appPage = new Array(); 		// Set APP settings
	appPage[0] = 291;       	// width
	appPage[1] = 355;			// height
	appPage[2] = 0;				// x
	appPage[3] = 0;				// y
	appPage[4] = 300;			// height offset
	appPage[5] = 30;			// margin offset between the 2 windows
	
	
var availscreenspace = new Array();
	availscreenspace[0] = screen.width - (appPage[0] + appPage[5]); //Find availible width of userscreen
	availscreenspace[1] = screen.height - (100); 					//Find availible height of userscreen.


var youtubeWindow;

//AS calls from the widget
var ponder = {
    goHref: function(o){
			
          /*if(o.name == 'youtube/' && $.browser.msie)
            {
                $('#myiframe').attr('src', "youtube.html");
                
            }else if(o.url) 
            {
                $('#myiframe').attr('src', o.url);
            }*/
		if(o.name == "logo/"){
			window.resizeTo(screen.width,availscreenspace[1]);
			window.moveTo(0,0);
			window.location = o.url;
		}else{
			window.resizeTo(appPage[0],appPage[1]+appPage[4]);
			window.moveTo(appPage[2],appPage[3]);
			window.open(o.url, "ponderContent", 'width='+ availscreenspace[0] +',height='+ (availscreenspace[1]) +',left=' + (appPage[0] + appPage[5]) + ',top=0,scrollbars=1');
			
			if(window.location.href.indexOf("index.html") != -1) {
				window.location = "ponder_me_widget.html";
			}
		}

  			
        $("#flashContent").focus();
		   /*this.enableDrag();*/
    },
    /*disableDrag: function(){
        //console.log('>>>>>>>>>>>>>>>>>>>>>>>>  ponder.disableDrag');
        $("#draggable").draggable('disable');
    },
    enableDrag: function(){
        //console.log('>>>>>>>>> ponder.enableDrag');
        $("#draggable").draggable('enable');
    },*/
    setFlashHeight: function(open){
	 	this.disableDrag();
       var h;
        if (open == true) 
            h = 365;
        else 
            h = 75;
				
       $("#flashContent").height(h);
		 //this.enableDrag();
    },
    trackEvent: function(obj){
        //console.log('trackEvent >> ' + 'cat:' + obj.category + ' action:' + obj.action);
        pageTracker._trackEvent(obj.category, obj.action);
    }
}
