var $WSR = jQuery.noConflict();

$WSR(function() {
	$WSR('.cloud1wrap').mouseover(function() {
		$WSR('.cloud3wrap').show();
		$WSR(this).hide();
	});
	
	$WSR('.cloud3wrap').mouseleave(function(e){
		$WSR(this).hide();
		$WSR(".Col2").hide();
		$WSR('.cloud1wrap').show();
	});
	
	$WSR(".cloud3wrap .Col1 ul li").hover(function(e){
		var num = this.id.substring(9);
		$WSR(".Col2").hide();
		$WSR("#submenu-" + num).show();
	});
});

$WSR(document).ready(function() {

    // Start the cycle for the banners
    $WSR('#bannercycle').cycle({ speed: 4000 });

    // Open all external references in a new window
    var externico = '<img class="externico" src="/Design/WoonstadRotterdamDesign2010/images/ico_extern.gif" alt="Externe link" title="Externe link"/>';
    // Handle new window
    $WSR('a[href^="http://"]:not(a[href="http://www.woonstadrotterdam.nl"]), a[href$=".pdf"], a[href$=".doc"], a[href$=".docx"]').attr("target", "_blank");
    // Handle external icon, except if a links has a image
    $WSR('a[href^="http://"]:not(a[href^="http://"]:has(img), a[href^="http://maps.google"]), a[href$=".pdf"]:not(a[href$=".pdf"]:has(img)), a[href$=".doc"]:not(a[href$=".doc"]:has(img)), a[href$=".docx"]:not(a[href$=".docx"]:has(img))').append(externico);
    $WSR('.externico').css('display', 'inline')

    // Searchbox
    var sDefaultSearchtest = 'zoeken...';
    $WSR('#searchtext').val(sDefaultSearchtest);
    $WSR('#searchtext').focus(function(){
        if ($WSR('#searchtext').val() == '' || $WSR('#searchtext').val() == sDefaultSearchtest)
        {
            $WSR('#searchtext').val('');
        }
    });
    $WSR('#searchtext').blur(function(){
      if ($WSR('#searchtext').val() == '')
      {
          $WSR('#searchtext').val(sDefaultSearchtest);
      }
    });

});


