$.extend({getUrlVar:function(b,a){if(!a){a=window.location.href}b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c=new RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);if(c==null){return null}else{return decodeURIComponent(c[1].replace(/\+/g," "))}}});pres_mode=$.getUrlVar("mode");ws_mode=$.getUrlVar("ws");$("#tools_title_hs_ico").bind("click",function(){hs_content_ico("tools",0,1000)});$("#marketing_title_hs_ico").bind("click",function(){hs_content_ico("marketing",1,1000);hs_content_ico("features",1,1000)});$("#features_title_hs_ico").bind("click",function(){});$("#resources_title_hs_ico").bind("click",function(){hs_content_ico("resources",1,1000)});function hs_content_ico(c,a,b){if(c=="resources"||c=="features"){move_to=$("#"+c+"_content").height()}if(c=="tools"){move_to_tools=$("#"+c+"_content").height()}if(a){URL_SHOW="url(images/additional_hs_show_ico.png)";URL_HIDE="url(images/additional_hs_hide_ico.png)"}else{URL_SHOW="url(images/tools_hs_show_ico.png)";URL_HIDE="url(images/tools_hs_hide_ico.png)"}if($("#"+c+"_content").is(":hidden")){$("#"+c+"_content").slideDown(b);$("#"+c+"_title_hs_ico").css({"background-image":URL_HIDE})}else{$("#"+c+"_content").slideUp(b);$("#"+c+"_title_hs_ico").css({"background-image":URL_SHOW})}}function hs_media_hint(c,b,a){if($("#"+c+"_hint").is(":hidden")&&b=="mouseover"){$("#"+c+"_hint").show()}else{$("#"+c+"_hint").hide()}}function show_date_popup(a,c,b){if($("#"+a+"").is(":hidden")&&c=="mouseover"){$("#"+a+"").slideRight(500)}else{$("#"+a+"").slideLeft(500)}}$("#top_right_node").css({cursor:"pointer"});$("#top_right_node").bind("click",function(){$("#agent_v_card").fadeOut("slow");$("#agent_minified").fadeIn("slow")});$("#agent_minified_button").bind("mouseover",function(){$("#agent_minified_button").css({"background-image":"url('images/agent_minfo_act_but.png')"})});$("#agent_minified_button").bind("mouseout",function(){$("#agent_minified_button").css({"background-image":"url('images/agent_minfo_pas_but.png')"})});$("#agent_minified_button").bind("click",function(){$("#agent_minified").fadeOut("slow");$("#agent_v_card").fadeIn("slow")});$("#testemonials_login_butt").bind("click",function(){window.open("http://vifp.com/login.php","_blank")});$("#testemonials_ico_1").bind("click",function(){window.open("http://vifp.com/order_visit_stat.php?order_id="+order_id,"_blank")});if((pres_mode=="branded")||(pres_mode==null)){if(agent_website!=""){$("#powered_by").bind("click",function(){if(agent_website.indexOf("http://")<0){agent_website="http://"+agent_website+"/"}window.open(agent_website,"_blank")});$("#powered_by").css({cursor:"pointer"});$("#powered_url").css({cursor:"pointer"})}if(sponsor_website!=""){$("#sponsored_by").bind("click",function(){if(sponsor_website.indexOf("http://")<0){sponsor_website="http://"+sponsor_website+"/"}window.open(sponsor_website,"_blank")});$("#sponsored_by").css({cursor:"pointer"});$("#powered_url").css({cursor:"pointer"})}}else{$("#powered_url").css({cursor:"default"})}$("#tools_download").bind("click",function(){detectPosition("download_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#download_popup").fadeIn("slow")});$("#close_download_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#download_popup").fadeOut("slow")});$("#tools_embed").bind("click",function(){detectPosition("embed_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#embed_popup").fadeIn("slow")});$("#close_embed_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#embed_popup").fadeOut("slow")});$("#tools_send").bind("click",function(){detectPosition("send_tour_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#send_tour_popup").fadeIn("slow")});$("#close_send_tour_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#send_tour_popup").fadeOut("slow")});$("#c_mail").css("cursor","pointer");$("#c_mail").bind("click",function(){$("#close_agent_minfo").click();$("#tools_contact").click()});$("#tools_contact").bind("click",function(){detectPosition("contact_tour_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#contact_tour_popup").fadeIn("slow")});$("#close_contact_tour_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#contact_tour_popup").fadeOut("slow")});$("#schedule_popup").bind("click",function(){detectPosition("schedule_tour_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#schedule_tour_popup").fadeIn("slow")});$("#close_schedule_tour_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#schedule_tour_popup").fadeOut("slow")});$("#agent_popup").bind("click",function(){detectPosition("agent_info_popup");$("#backgroundFader").css({opacity:"0.7"});$("#backgroundFader").fadeIn("slow");$("#agent_info_popup").fadeIn("slow")});$("#close_agent_info_popup").bind("click",function(){$("#backgroundFader").fadeOut("slow");$("#agent_info_popup").fadeOut("slow")});$("#download_master_button").bind("mouseover",function(){$("#download_master_button").css({"background-image":"url('images/tools_dl_button_act.png')"})});$("#download_master_button").bind("mouseout",function(){$("#download_master_button").css({"background-image":"url('images/tools_dl_button_pass.png')"})});$("#download_exec_button").bind("mouseover",function(){$("#download_exec_button").css({"background-image":"url('images/tools_dl_button_act.png')"})});$("#download_exec_button").bind("mouseout",function(){$("#download_exec_button").css({"background-image":"url('images/tools_dl_button_pass.png')"})});$("#send_tour_button").bind("mouseover",function(){$("#send_tour_button").css({"background-image":"url('images/tools_st_button_act.png')"})});$("#send_tour_button").bind("mouseout",function(){$("#send_tour_button").css({"background-image":"url('images/tools_st_button_pass.png')"})});$("#contact_tour_button").bind("mouseover",function(){$("#contact_tour_button").css({"background-image":"url('images/tools_st_button_act.png')"})});$("#contact_tour_button").bind("mouseout",function(){$("#contact_tour_button").css({"background-image":"url('images/tools_st_button_pass.png')"})});$("#schedule_tour_button_pass").bind("mouseover",function(){$("#schedule_tour_button_pass").css({"background-image":"url('images/tools_sch_button_act.png')"})});$("#schedule_tour_button_pass").bind("mouseout",function(){$("#schedule_tour_button_pass").css({"background-image":"url('images/tools_sch_button_pass.png')"})});$("#ignore_flash").bind("mouseover",function(){$("#ignore_flash").css({"background-image":"url('images/tools_st_button_act.png')"})});$("#ignore_flash").bind("mouseout",function(){$("#ignore_flash").css({"background-image":"url('images/tools_st_button_pass.png')"})});$("#update_flash").bind("mouseover",function(){$("#update_flash").css({"background-image":"url('images/tools_st_button_act.png')"})});$("#update_flash").bind("mouseout",function(){$("#update_flash").css({"background-image":"url('images/tools_st_button_pass.png')"})});var xMin,yMin,xMax,yMax;function refreshClientDimensions(){if(!$("#send_tour_popup").is(":hidden")){var a="send_tour_popup"}if(!$("#embed_popup").is(":hidden")){var a="embed_popup"}if(!$("#download_popup").is(":hidden")){var a="download_popup"}if(!$("#schedule_tour_popup").is(":hidden")){var a="schedule_tour_popup"}if(!$("#agent_info_popup").is(":hidden")){var a="agent_info_popup"}if(!$("#contact_tour_popup").is(":hidden")){var a="contact_tour_popup"}if(typeof(a)!="undefined"){detectPosition(a)}}function detectPosition(a){xMax=document.documentElement.clientWidth;yMax=document.documentElement.clientHeight;xMin=document.documentElement.scrollLeft;yMin=document.documentElement.scrollTop;leftPos=(xMax/2)+xMin-285;topPos=(yMax/2)+yMin-200;$("#"+a+"").css("left",leftPos);$("#"+a+"").css("top",topPos)}window.onresize=refreshClientDimensions;window.onscroll=refreshClientDimensions;function validateFormAndSendTourAndContact(m){var n=$("#"+m+"_tour_recepient_emails").val();var j=$("#"+m+"_tour_sender_name").val();var d=$("#"+m+"_tour_sender_email").val();var e=$("#"+m+"_tour_message").val();var c=$("#"+m+"_tour_brand_options:checked").val();var a=$("#"+m+"_tour_recepient_email_error");var h=$("#"+m+"_tour_sender_name_error");var b=$("#"+m+"_tour_sender_email_error");var p=$("#"+m+"_tour_message_error");var l=0;var k=0;if(m=="send"){l++;if(n!=""){var q=/^[^#%&\\\/)(?]+@[^#%&\\\/)(?]+\.[^#%&\\\/)(?]+$/i;var f=n.split(",");var o=0;var g=0;for(i in f){if(f[i].lenght<6||f[i].lenght>50){g++}else{if(!q.test(f[i])){o++}}}if(o>0||g>0){a.text("Friend Email(s) has incorrect format or length not within 6 and 50 characters");a.show();if(!k){k=$("#"+m+"_tour_recepient_emails")}}else{a.text("");a.hide();l--}}else{a.text("Friend Email(s) should not be empty");a.show();if(!k){k=$("#"+m+"_tour_recepient_emails")}}}l++;if(j==""){h.text("Your Full Name should not be empty.");h.show();if(!k){k=$("#"+m+"_tour_sender_name")}}else{h.text("");h.hide();l--}l++;if(d!=""){q=/^[^#%&\\\/)(?]+@[^#%&\\\/)(?]+\.[^#%&\\\/)(?]+$/i;o=0;g=0;if(d.lenght<6||d.lenght>50){g++}else{if(!q.test(d)){o++}}if(o>0||g>0){b.text("Your Email Address has incorrect format or length not within 6 and 50 characters");b.show();if(!k){k=$("#"+m+"_tour_sender_email")}}else{b.text("");b.hide();l--}}else{b.text("Your Email Address should not be empty");b.show();if(!k){k=$("#"+m+"_tour_sender_email")}}if(k){k.focus()}var n=$("#"+m+"_tour_recepient_emails").val();var j=$("#"+m+"_tour_sender_name").val();var d=$("#"+m+"_tour_sender_email").val();var e=$("#"+m+"_tour_message").val();var c=$("#"+m+"_tour_brand_options:checked").val();if(!l){$.getJSON("presentation.php",{recepient_email:n,sender_full_name:j,sender_email_address:d,sender_text_message:e,send_unbranded:c,order_id:order_id,form_type:m,mode:pres_mode},function(r){if(""!=r){$("#backgroundFader").fadeOut("slow");$("#"+m+"_tour_popup").fadeOut("slow");$("#"+m+"_tour_recepient_emails").val("");$("#"+m+"_tour_sender_name").val("");$("#"+m+"_tour_sender_email").val("");$("#"+m+"_tour_message").val("");$("#"+m+"_tour_brand_options:checked").val("")}else{alert("Some error occured.<br/>Please try later.")}})}}$("#send_tour_button").bind("click",function(){validateFormAndSendTourAndContact("send")});$("#contact_tour_button").bind("click",function(){validateFormAndSendTourAndContact("contact")});function draw_area_map_block(){$("#map").css("height",content_height+"px");$("#map").css("display","block");$("#gallery_content").css({"background-image":"none"});if(!map_loaded){load_map();map_loaded=true}else{$("#map").css("width",content_width+"px");if(map){map.checkResize()}}}function draw_media_walkthru_block(g,k,j,h,e,a,l,f){if(e=="branded"){e=1}else{e=0}var b={CUST_ID:g,MLS_ID:k,BTNS:"0,0,0,0,0",PRES_ID:h,BRANDED:e,BG_COLOR:l,WS:widescreen,DONT_START:f,SVR:a};var c={allowscriptaccess:"sameDomain",allowfullscreen:true,quality:"high",bgcolor:"#000000",wmode:"opaque"};var d={};$("#gallery_content_tours").html('<div id="flash_object"></div>');swfobject.embedSWF("walkthru.swf","flash_object",content_width,content_height,"9.0.0","expressInstall.swf",b,c,d);$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").css({"background-color":"transparent"});$("#gallery_content_tours").show()}function draw_media_floorplan_block(d,g,c,f){var a={PID:d,OID:g,HIDEFT:"1",BBU:"0x000000",BBO:"0x191919",BBD:"0x000000",BLU:"0x000000",BLO:"0x191919",BLD:"0x000000",BTU:"0xFFFFFF",BTO:"0xFFFFFF",BTD:"0xFF8040",FT_TEXT:"Full Tour",EMBEDDED:0,EMB_WIDTH:content_width,EMB_HEIGHT:content_height,SVR:c};var e={allowscriptaccess:"sameDomain",allowfullscreen:true,quality:"high",bgcolor:"#ffffff",wmode:"opaque"};var b={};$("#gallery_content_tours").html('<div id="flash_object"></div>');switch(f){case"0":swfobject.embedSWF("http://vifp.com/presentation/panorama_banner1.1.swf","flash_object",content_width,content_height,"9.0.0","expressInstall.swf",a,e,b);$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").css({"background-color":"transparent"});break;case"1":swfobject.embedSWF("http://vifp.com/presentation_v2/main.swf","flash_object",content_width,content_height,"9.0.0","expressInstall.swf",a,e,b);$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").css({"background-color":"transparent"});break}$("#gallery_content_tours").show()}function draw_default_block(a){$("#gallery_content").css({"background-image":"url('images/"+a+"_sample.png')"})}function draw_media_floorplanner(a){$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").html('<iframe style="z-index:2;" src="http://floorplanonline.floorplanner.com/'+a+'/embed" width='+content_width+" height="+content_height+' frameborder="0" scrolling="no">');$("#gallery_content_tours").show()}function draw_photo_gallery(f,j,h,g,e,a,k){if(e=="branded"){e=1}else{e=0}var b={CUST_ID:f,MLS_ID:j,BTNS:"0,0,0,0,0",PRES_ID:g,BRANDED:e,BG_COLOR:k,WS:widescreen,SVR:a};var c={allowscriptaccess:"sameDomain",allowfullscreen:true,quality:"high",bgcolor:"#000000",wmode:"opaque"};var d={};$("#gallery_content_tours").html('<div id="flash_object"></div>');swfobject.embedSWF("slideshow.swf","flash_object",content_width,content_height,"9.0.0","expressInstall.swf",b,c,d);$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").css({"background-color":"transparent"});$("#gallery_content_tours").show()}function activate_media_buttons(a){for(key in a){key=a[key];$("#"+key).bind("mouseover",(function(b){return function(){$("#"+b+"_img").stop().animate({left:"20px",width:"75%"},500)}})(key));$("#"+key).bind("mouseout",(function(b){return function(){back="60%";if(key=="disclousers"||key=="agreement"){back="62%"}$("#"+b+"_img").stop().animate({left:"30px",width:back},500)}})(key))}}var kkeys=[],konami="38,38,40,40,37,39,37,39,66,65";$(document).keydown(function(a){kkeys.push(a.keyCode);if(kkeys.toString().indexOf(konami)>=0){$(document).unbind("keydown",arguments.callee);$.getScript("http://www.cornify.com/js/cornify.js",function(){cornify_add();$(document).keydown(cornify_add)})}});function getPrintPackZip(){$.getJSON("presentation.php",{order_id:order_id,get_print_pack_zip:"true"},function(a){if(""!=a){window.open(a[0].url)}else{alert("Some error occured.<br/>Please try later.")}})}function resize_window(){$("#additional_title_center_1").css({width:475});$("#additional_title_center_3").css({width:475});$("#main_title_line").css({width:640});$("#main_title_address_line").css({width:640});$("#gallery_content").css({width:640});$("#gallery_content").css({height:480});$("#gallery_content_tours").css({width:640});$("#gallery_content_tours").css({height:480});$("#sub_gallery_content").css({width:640});$("#marketing_title_container").css({width:640});$("#marketing_title_container").css({width:640});$("#map").css({width:640});$("#map").css({height:480});$("#map_directions").css({height:480});$("#map_streetview").css({height:480});$("#agent_v_card").css({left:600});$("#agent_minified").css({left:710});$("#q_media_photos").css({width:318});$("#q_media_amap").css({width:318});$("#q_media_walkthru").css({width:318});$("#q_media_floorplan").css({width:318});$("#q_media_photos").css({height:238});$("#q_media_amap").css({height:238});$("#q_media_walkthru").css({height:238});$("#q_media_floorplan").css({height:238});$("#bottom_container").css({"min-width":640});$("#bottom_container").css({width:640});$("#bottom_main_container").css({width:640});$("#resources_title_container").css({width:640});$("#resources_row").css({width:640});total_count=0;$("#resources_row > *").each(function(){total_count++;html=$(this).html();id=$(this).attr("id");$("#"+id+" > a").each(function(){html=$(this).html();if(html==""){total_count--;$("#"+id).remove()}})});if(total_count%4){while(total_count%4){$("#resources_row").append('<div style="width: 151px;" class="cell21" id="resources_cellx'+total_count+'"></div>');total_count++}}vclass="cell21";$("#resources_row > *").each(function(){$(this).attr("class",vclass);if(vclass=="cell21"){vclass="cell22"}else{vclass="cell21"}});$("#pmaterials_front_picture").css({width:250});$("#pmaterials_front_picture").css({height:187});$("#pmaterials_front_photo").css({width:250});$("#pmaterials_front_photo").css({height:187});$("#more_info_front_picture").css({width:250});$("#more_info_front_picture").css({height:187});$("#minfo_front_photo").css({width:250});$("#minfo_front_photo").css({height:187});$("#pmaterials_print_ico").css({top:0});$("#buttons_block").css({top:190});$("#buttons_block_more_info").css({top:190});$("#row_bot").css({width:640});$("#master_row").css({width:820});$("#sponsor").css({width:640});$("#minfo_label").css({left:300});$("#pmaterial_print_ico").css({left:300});content_width=640;content_height=480}function resize_window_ws(){$("#additional_title_center_1").css({width:555});$("#additional_title_center_3").css({width:555});$("#main_title_line").css({width:720});$("#main_title_address_line").css({width:720});$("#gallery_content").css({width:720});$("#gallery_content").css({height:450});$("#gallery_content_tours").css({width:720});$("#gallery_content_tours").css({height:450});$("#sub_gallery_content").css({width:720});$("#marketing_title_container").css({width:720});$("#marketing_title_container").css({width:720});$("#map").css({width:720});$("#map").css({height:450});$("#map_directions").css({height:450});$("#map_streetview").css({height:450});$("#agent_minfo2").css({left:680});$("#agent_minified").css({left:790});$("#q_media_photos_wide").css({width:358});$("#q_media_amap_wide").css({width:358});$("#q_media_walkthru_wide").css({width:358});$("#q_media_floorplan_wide").css({width:358});$("#q_media_photos_wide").css({height:223});$("#q_media_amap_wide").css({height:223});$("#q_media_walkthru_wide").css({height:223});$("#q_media_floorplan_wide").css({height:223});$("#bottom_container").css({"min-width":720});$("#bottom_container").css({width:720});$("#bottom_main_container").css({width:720});$("#resources_title_container").css({width:720});$("#resources_row").css({width:720});total_count=0;$("#resources_row > *").each(function(){total_count++;html=$(this).html();id=$(this).attr("id");$("#"+id+" > a").each(function(){html=$(this).html();if(html==""){total_count--;$("#"+id).remove()}})});if(total_count%4){while(total_count%4){$("#resources_row").append('<div style="width: 158px;" class="cell21" id="resources_cellx'+total_count+'"></div>');total_count++}}vclass="cell21";$("#resources_row > *").each(function(){$(this).attr("class",vclass);if(vclass=="cell21"){vclass="cell22"}else{vclass="cell21"}$(this).attr("style","width: 170px")});$("#pmaterials_front_picture").css({width:250});$("#pmaterials_front_picture").css({height:187});$("#pmaterials_front_photo").css({width:250});$("#pmaterials_front_photo").css({height:187});$("#more_info_front_picture").css({width:250});$("#more_info_front_picture").css({height:187});$("#minfo_front_photo").css({width:250});$("#minfo_front_photo").css({height:187});$("#pmaterials_print_ico").css({top:0});$("#buttons_block").css({top:190});$("#buttons_block_more_info").css({top:190});$("#row_bot").css({width:720});$("#master_row").css({width:900});$("#sponsor").css({width:720});$("#minfo_label").css({left:300});$("#pmaterial_print_ico").css({left:300});content_width=720;content_height=450}if(ws_mode=="1"){vclass="cell21";$("#resources_row > *").each(function(){$(this).attr("class",vclass);if(vclass=="cell21"){vclass="cell22"}else{vclass="cell21"}})}function align_agent_info_card(){height=$("#middle_central_node").height();$("#middle_left_node").height(height);$("#middle_right_node").height(height);$("#middle_central_node").height(height);width=$("#middle_central_node").width();width=(width<390)?390:width;$("#top_central_node").width(width);$("#middle_central_node").width(width);$("#bottom_central_node").width(width);$("#agent_v_card").width(width+28);vcard_pos=((173+content_width)-(width+28));c_info_width=width-130;$("#c_info").width(c_info_width);$("#agent_v_card").animate({left:vcard_pos+"px"},1500)}function getFlashVersion(){try{try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{a.AllowScriptAccess="always"}catch(b){return"6,0,0"}}catch(b){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(b){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(b){}}return"0,0,0"}function flashChecker(){var a=getFlashVersion().split(",").shift();if(a<10){$.blockUI({message:$("#flashChecker")});$("#update_flash").click(function(){window.open("http://www.adobe.com/products/flashplayer/","_blank");$.unblockUI()});$("#ignore_flash").click(function(){$.unblockUI();window.location.replace(old_flash_url)})}}function draw_custom_embeded_video(a){width_pattern=/width=\"\d{1,4}\"/g;height_pattern=/height=\"\d{1,4}\"/g;wmode_pattern_1=/<\/object>/g;wmode_pattern_2=/><\/embed>/g;a=a.replace(width_pattern,'width="'+content_width+'"');a=a.replace(height_pattern,'height="'+content_height+'"');a=a.replace(wmode_pattern_2,' wmode="opaque" /></embed>');a=a.replace(wmode_pattern_1,'<param name="wmode" value="opaque" /></object>');$("#gallery_content_tours").html(a);$("#gallery_content_tours").css({"background-image":"none"});$("#gallery_content_tours").css({"background-color":"transparent"});$("#gallery_content_tours").show()};
