//  Leasing Advertisement Random Property Generator -->
function writeNorthPropertiesMatt(){ 
var propertyLink //TBD
var propertyAvailability; // TBD
var propertyImage; // TBD
var propertyName; // TBD 
var propertyType; // TBD 
var num_of_properties = 8;
propertyNumber = Math.floor (num_of_properties * Math.random());

switch(propertyNumber) {
	case 0:
		propertyLink="../123-E-Powell-Blvd.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-123-E-Powell.jpg";
		propertyName="123 E Powell";
		propertyType="High Quality Office &amp; Retail Suites in Gresham";
	break;
}

switch(propertyNumber) {
	case 1:
		propertyLink="../819-SE-Morrison-St.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-819-SE-Morrison.jpg";
		propertyName="819 SE Morrison";
		propertyType="High Quality Office Suites";
	break;
}

switch(propertyNumber) {
	case 2:
		propertyLink="../4152-NE-Sandy-Blvd.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-4152-NE-Sandy.jpg";
		propertyName="4152 NE Sandy";
		propertyType="High Quality Office &amp; Retail Suites in Hollywood";
	break;
}

switch(propertyNumber) {
	case 3:
		propertyLink="../3524-3534-SE-52nd-Ave-FL.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-4152-NE-Sandy.jpg";
		propertyName="Pikes Peak";
		propertyType="Street Level Retail on SE Powell";
	break;
}

switch(propertyNumber) {
	case 4:
		propertyLink="../8083-SE-13th-FL.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-8083-SE-13th.jpg";
		propertyName="Mt. Kilimanjaro";
		propertyType="Retail &amp; Office in Sellwood";
	break;
}

switch(propertyNumber) {
	case 5:
		propertyLink="../8714-8722-SE-17th-Ave-FL.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-8714-SE-17th.jpg";
		propertyName="Marion Peak";
		propertyType="Street Level Retail in Sellwood";
	break;
}

switch(propertyNumber) {
	case 6:
		propertyLink="../8805-SW-Canyon-Lane.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-8805-SW-Canyon-Lane.jpg";
		propertyName="West Slope Shopping Center";
		propertyType="Retail Center in West Slope";
	break;
}

switch(propertyNumber) {
	case 7:
		propertyLink="../9225-SW-Hall-Blvd.html";
		propertyAvailability="FOR LEASE";
		propertyImage="../images/ads/Ad-9225-SW-Hall-blvd.jpg";
		propertyName="Greenburg Corners";
		propertyType="High Quality Office &amp; Retail Suites";
	break;
}

 // THE ORIGIIONAL WAY:
document.write('<div class=ad>' + '<a href="'+ propertyLink +'">' + '<span class=red>' + propertyAvailability + '</span>' + '<img src="' + propertyImage + '"/>' + '<span>' + propertyName + '<br/>' + '<i>' + propertyType + '</i>' + '</span>' + '</a>' + '</div>');

}
//  End -->

//  Sales Advertisement Random Property Generator -->
function writeNorthPropertiesJeffrey(){ 
var propertyLink //TBD
var propertyAvailability; // TBD
var propertyImage; // TBD
var propertyName; // TBD 
var propertyType; // TBD 
var num_of_properties = 6;
propertyNumber = Math.floor (num_of_properties * Math.random());

switch(propertyNumber) {
	case 0:
		propertyLink="../12525-SW-Main.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-12525-SW-Main.jpg";
		propertyName="12525 SW Main";
		propertyType="Zoned for Office &amp; Retail";
	break;
}

switch(propertyNumber) {
	case 1:
		propertyLink="../8714-8724-SE-17th-Ave.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-8714-SE-17th.jpg";
		propertyName="Marion Peak";
		propertyType="NNN Leased Retail Investment";
	break;
}

switch(propertyNumber) {
	case 2:
		propertyLink="../4945-NE-7th-Ave.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-4945-NE-7th.jpg";
		propertyName="4945 NE 7th";
		propertyType="NNN Leased Office Investment";
	break;
}

switch(propertyNumber) {
	case 3:
		propertyLink="../2600-NE-Sandy-Blvd.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-2600-NE-Sandy.jpg";
		propertyName="Mt. McKinley Building";
		propertyType="NNN Leased Retail Investment";
	break;
}

switch(propertyNumber) {
	case 4:
		propertyLink="../2122-SE-Division-Ave.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-2122-SE-Division.jpg";
		propertyName="Mt. Baker Building";
		propertyType="NNN Leased Retail Investment";
	break;
}
switch(propertyNumber) {
	case 5:
		propertyLink="../1808-SE-Belmont.html";
		propertyAvailability="FOR SALE";
		propertyImage="../images/ads/Ad-1808-SE-Belmont.jpg";
		propertyName="1808 SE Belmont";
		propertyType="NNN Leased Office Investment";
	break;
}


 // THE ORIGIIONAL WAY:
document.write('<div class=ad>' + '<a href="'+ propertyLink +'">' + '<span class=red>' + propertyAvailability + '</span>' + '<img src="' + propertyImage + '"/>' + '<span>' + propertyName + '<br/>' + '<i>' + propertyType + '</i>' + '</span>' + '</a>' + '</div>');

}
//  End -->

//  Random Testimonial Generator -->
function writeNorthRimTestimonials(){ 
var quoteName; // TBD
var quoteBody; // TBD 
var num_of_quotes = 2;
quoteNumber = Math.floor (num_of_quotes * Math.random());

switch(quoteNumber) {
	case 0:
		quoteBody="<span>N</span>orth Rim Partners showed me all of the available properties in the market place that fit my criteria. When we found the right property, I knew that it was not only the right fit, but the best deal for me.<br><br>They provided a high level of service and market knowledge through the entire process.";
		quoteName="Dale Lovett, Lovett Excavating";
	break;
}
switch(quoteNumber) {
	case 1:
		quoteBody="<span>T</span>he team at North Rim was super super amazing & crazy to work with, not to mention how handsome they are. I was able to open my doors within 59 days of initially calling them.<br><br>They provided a tremendous amount of great service and value to me. They are the best of the best in Portland, Oregon and Thailand.";
		quoteName="Marc DePor, Owner - Sushi Mazi";
	break;
} 
 // THE ORIGIIONAL WAY:
document.write('<blockquote>' + quoteBody +'<br>' + '<span class=name>' + quoteName + '</span>' + '</blockquote>');
}
//  End -->

// Pop Up Function For the Contact Form THIS IS THE JAVASCRIPT ERROR IN IE-->
  jQuery(function($){
    $('#contact_us').submit(function(){ 
      $.post($(this).attr('action'), function(html) { 
        $('#content').html(html)
      })
      return false
    })
  })
//End Pop Up Function


//BEING JAVASCRIPT ON THE INDEX PAGE ONLY/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//  HOMEPAGE RANDOM QUOTE GENERATOR -->
function writeHomePageQuotes(){ 
var quoteBody; // TBD 
var num_of_quotes = 2;
quoteNumber = Math.floor (num_of_quotes * Math.random());

switch(quoteNumber) {
	case 0:
		quoteBody="src='images/expertise.jpg' alt='Put Our Expertise To Work For You' title='Put Our Expertise To Work For You'";
	break;
}
switch(quoteNumber) {
	case 1:
		quoteBody="src='images/real-estate-solutions.jpg' alt='Put Our Expertise To Work For You' title='Put Our Expertise To Work For You'";
	break;
}
 // output:
document.write('<img ' + quoteBody + 'class="quote"' + '/>');
}
//  END HOMEPAGE RANDOM QUOTE GENERATOR -->



//BEGING SLIDESHOW

function slideSwitch() {
    var $active = $('#header IMG.active');

    if ( $active.length == 0 ) $active = $('#header IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#header IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});