function inElementInp (objInp, defVal)
{
    if(objInp.val() == defVal || objInp.val() == '')
    {
    	objInp.attr('value', '');
    	objInp.css('color', '#000000');
    }    	
}

function outElementInp (objInp, defVal) 
{
    if(objInp.val() == defVal || objInp.val() == '')
    {
    	objInp.attr('value', defVal);
    	objInp.css('color', '#898989');
        
    } else {
    	objInp.css('color', '#000000');
    }
}
    
$(document).ready(function() {

    var spt = $('span.mailme');
    var at = / at /;
    var dot = / dot /g;
    var addr = $(spt).text().replace(at,"@").replace(dot,".");
    $(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
    .hover(function(){window.status="Send a letter!";}, function(){window.status="";});
    $(spt).remove();

    var spt = $('span.mailme2');
    var at = / at /;
    var dot = / dot /g;
    var addr = $(spt).text().replace(at,"@").replace(dot,".");
    $(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
    .hover(function(){window.status="Send a letter!";}, function(){window.status="";});
    $(spt).remove();
    
	//email
    /*
	outElementInp($("#email"), 'Email Address');
	$("#email").focus(function() {
		inElementInp($(this), 'Email Address');
	});
	$("#email").blur(function() {
		outElementInp($(this), 'Email Address');
	});
	*/
	///email    
    
    //Wflir.replace( $(".menu-left h1"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/startups_label.gif)', 'background-repeat': 'no-repeat', 'background-position': 'bottom right' } );
    Wflir.replace( $(".header-main-slog"), { 'float': 'left', 'width': '100%', 'height': '109px', 'background-image': 'url(' + baseUrl + '/themes/default/images/main-slogan.png)', 'background-repeat': 'no-repeat', 'background-position': '20px 0px', 'margin': '0' } );

    //madnes
    Wflir.replace( $(".menu-left a"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/logo_big.gif)', 'background-repeat': 'no-repeat', 'background-position': '0 5px', 'width': '151px', 'height': '45px' } );
    Wflir.replace( $(".left-ad-head a"), { 'float': 'left', 'width': '285px', 'height': '44px', 'background-image': 'url(' + baseUrl + '/themes/default/images/startups_label.gif)', 'background-repeat': 'no-repeat', 'background-position': '25px 15px' } );
    Wflir.replace( $(".middle-ad-head a"), { 'float': 'left', 'width': '180px', 'height': '44px', 'background-image': 'url(' + baseUrl + '/themes/default/images/advertisers_label.gif)', 'background-repeat': 'no-repeat', 'background-position': '25px 15px' } );
	Wflir.replace( $(".right-ad-head a"), { 'float': 'left', 'width': '181px', 'height': '153px', 'background-image': 'url(' + baseUrl + '/themes/default/images/right_ad_head.png)', 'background-repeat': 'no-repeat', 'background-position': '0px 0px' } );
    Wflir.replace( $(".footer-top-content-head h3"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/invitation-only.gif)', 'background-repeat': 'no-repeat', 'background-position': 'center' } );
    Wflir.replace( $(".footer-top-content-bottom h3"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/they_choose_to.gif)', 'background-repeat': 'no-repeat', 'background-position': '10px 5px' } );

    /*pricing-and-signup*/
    //left
    Wflir.replace( $(".left-ad-head-text"), { 'float': 'left', 'width': '100%', 'height': '100%', 'background-image': 'url(' + baseUrl + '/themes/default/images/left_ad_head.png)', 'background-repeat': 'no-repeat', 'background-position': 'top center' } );
    Wflir.replace( $(".left-ad-bottom-text"), { 'float': 'left', 'width': '100%', 'height': '100%', 'background-image': 'url(' + baseUrl + '/themes/default/images/left_ad_price_bottom.png)', 'background-repeat': 'no-repeat', 'background-position': 'bottom center' } );

    //mid
    Wflir.replace( $(".middle-ad-head-text"), { 'float': 'left', 'width': '100%', 'height': '100%', 'background-image': 'url(' + baseUrl + '/themes/default/images/middle_ad_head.png)', 'background-repeat': 'no-repeat', 'background-position': 'center', 'background-position': 'top center'} );
    Wflir.replace( $(".middle-ad-bottom-text"), { 'float': 'left', 'width': '100%', 'height': '100%', 'background-image': 'url(' + baseUrl + '/themes/default/images/middle_ad_price_bottom.png)', 'background-repeat': 'no-repeat', 'background-position': 'center', 'background-position': 'bottom center'} );

    //other
    Wflir.replace( $(".main-content-head-text-register"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/main-content-head-text.png)', 'background-repeat': 'no-repeat', 'background-position': 'center 35px'} );
    Wflir.replace( $(".main-content-form-head"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/main-content-form-head.png)', 'background-repeat': 'no-repeat', 'background-position': 'center center'} );
    Wflir.replace( $(".main-content-head-text-login"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/main-content-head-text-login.png)', 'background-repeat': 'no-repeat', 'background-position': 'center 35px'} );

	/*/pricing-and-signup*/
    
    //advertisers
    Wflir.replace( $("#advertisers-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/advertisers-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '102px', 'margin-bottom': '16px'} );
    
    //apps
    Wflir.replace( $("#apps-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/apps-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );

    //communities
    Wflir.replace( $("#communities-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	
    Wflir.replace( $("#communities-design-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-design-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	Wflir.replace( $("#communities-ux-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-ux-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	Wflir.replace( $("#communities-datavisualization-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-datavisualization-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	Wflir.replace( $("#communities-mobileapps-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-mobileapps-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	
	Wflir.replace( $("#communities-startups-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-startups-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	Wflir.replace( $("#communities-webdevelopment-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-webdevelopment-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
	Wflir.replace( $("#communities-work-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/communities-work-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
    
    //the-ad
    Wflir.replace( $("#the-ad-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/the-ad-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '107px', 'margin-bottom': '16px'} );
    
    //right for me
    Wflir.replace( $("#rightforme-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/rightforme-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );
    
    //monetization 
    Wflir.replace( $("#monetization-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/monetization-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );    

    //apply 
    Wflir.replace( $("#apply-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/apply-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '104px', 'margin-bottom': '16px'} );    

    //contact 
    Wflir.replace( $("#contact-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/contact-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '53px', 'margin-bottom': '16px'} );
    
    //how-it-works 
    Wflir.replace( $("#howitworks-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/how-it-works-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '53px', 'margin-bottom': '16px'} );    
    
	//jobs
    Wflir.replace( $("#jobs-title"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/jobs-title.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '53px', 'margin-bottom': '16px'} );    
    
	
    //current_advertisers_flir
    Wflir.replace( $("#current_advertisers_flir"), { 'background-image': 'url(' + baseUrl + '/themes/default/images/current_advertisers.png)', 'background-repeat': 'no-repeat', 'background-position': 'top left', 'height': '53px', 'margin-bottom': '16px'} );
    
});