$(document).ready(function(){
	$('#center .node img').each(function(){
		if($(this).css('float')=='left') {
				$(this).addClass('imgleft');
		}
		else if($(this).css('float')=='right') {
				$(this).addClass('imgright');
		}
		
	});
	
	/*INPUT*/
	$('#block-views--exp-search-page_1 #edit-keys').example('Search');
	//$('#block-views--exp-zoekscherm-default #edit-keys').example('Typ hier je trefwoord');
	
	/*ROUNDED CORNERS*/
	$('.form-submit').corner('3px');
	
	/*POSITIONING FOOTER*/
	var h_content = $('#squeeze').height();
	var h_sidebar = $('#sidebar-right').height();
	if(h_sidebar>h_content && $('#block-block-26').length == 0){	// block 26 is the christmas banner
		var marginTop = h_sidebar-h_content-$('#footer_content').height();
		if(marginTop>0){
			$('#footer_content').css('margin-top',marginTop+'px');
		}
	}	
	
	/*Plug-ins*/
	$('.view-plugins .view-content .views-row').each(function(){
		var $this = $(this),
			$title = $this.find('.views-field-title').css('cursor','pointer'),
			$content = $this.find('.views-field-body, .views-field-field-download-value');
		
		$title.click(function(){$content.toggle();})
		$content.toggle();
	});
});

function openLogin(){
	newWindow('http://downloads.buro2.be/htcomnet', 'popup', 800, 500, 1, 1, 0, 0, 0, 0, 0); return false;
	
	/*
	"this.href" refers to the URL given in the "a" tag; "'popup'" is the name of the popup window;
	600 is the width of the popup window; 500 is the height of the popup window; the numbers that
	follow designate whether a property is turned on ("1") or off ("0"), in this order:
	scrollbars, resizable, menubar, toolbar, addressbar, statusbar, fullscreen
	*/

	//window.open('http://downloads.buro2.be/htcomnet','Kyotopark-login','width=700,height=500,scrollbars=yes,toolbar=no,location=no'); return false
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    /*if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
    */
}
