/**
 * @Copyright CSSJockey - Web Design and Development
 * @Website: http://www.cssjockey.com
 * @Terms of Use: http://www.cssjockey.com/terms-of-use
 * If you change the contents below sky will fall on your head!
 */
$(document).ready(function(){
    $(".featured-mobile").click(function(){
	var mobileinfo = $(this).find('.mobileinfo').html();
	$("#featured-mobile-info").html(mobileinfo);
	return false;
    });

    $(".panel").each(function(){
	var heading = $(this).find("h2");
	var firstword = heading.text().split(' ')[0];
	var word2 = heading.text().split(' ')[1];
	var word3 = heading.text().split(' ')[2];
	var word4 = heading.text().split(' ')[3];
	var word5 = heading.text().split(' ')[4];
	var word6 = heading.text().split(' ')[5];
	if(word2 == undefined){ word2 = ''; }
	if(word3 == undefined){ word3 = ''; }
	if(word4 == undefined){ word4 = ''; }
	if(word5 == undefined){ word5 = ''; }
	if(word6 == undefined){ word6 = ''; }
	heading.html('<span class="red">'+firstword+'</span>'+' '+word2+' '+word3+' '+word4+' '+word5+' '+word6+'<span class="h2arrow"></span>');
    })

    $(".widget").each(function(){
	var heading = $(this).find("h2");
	var firstword = heading.text().split(' ')[0];
	var word2 = heading.text().split(' ')[1];
	var word3 = heading.text().split(' ')[2];
	var word4 = heading.text().split(' ')[3];
	var word5 = heading.text().split(' ')[4];
	var word6 = heading.text().split(' ')[5];
	if(word2 == undefined){ word2 = ''; }
	if(word3 == undefined){ word3 = ''; }
	if(word4 == undefined){ word4 = ''; }
	if(word5 == undefined){ word5 = ''; }
	if(word6 == undefined){ word6 = ''; }
	heading.html('<span class="red">'+firstword+'</span>'+' '+word2+' '+word3+' '+word4+' '+word5+' '+word6+'<span class="h2arrow"></span>');
    })
  

})

$(document).ready(function(){
    $('#compare-phones').submit(function(){
	var first = $('#first-phone').val();
	var second = $('#second-phone').val();
	if(first == 0){
	    alert("Please Select the First Phone");
	    return false;
	}
	else
	if(second == 0){
	    alert("Please Select the Second Phone");
	    return false;
	}
    });
    
    $('#search-phones').submit(function(){
	var first_res = $('#select-brand').val();
	var second = $('#model').val();
	if(first_res == 0){
	    alert("Please Select a Brand");
	    return false;
	}else
	if(second == 0){
	    alert("Please Enter a Model Name");
	    return false;
	}
    });
    
    $('#more-filter-form').submit(function(){
	var brand = $('#more-filter-brand').val();
	if(brand == 0){
	    alert("Please Select a Brand");
	    return false;
	}
    });
})
