String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};function CountRight(c,b,a){b.value=a+c.value.length}function removeSpaces(a){return a.split(" ").join("")}function chk_profile(a){if(document.getElementById("AppleUser").checked==false&&document.getElementById("Company").checked==false&&document.getElementById("Independent").checked==false&&document.getElementById("NonProfit").checked==false){alert("Please select your profile");document.getElementById("AppleUser").focus();return false}}function chk_businessregister(e){var c=document.getElementById("email").value;if(c.trim()==""){alert("Please enter email");document.getElementById("email").focus();return false}if(c.trim()!=""&&emailCheck(c)==false){alert("Please enter valid email");document.getElementById("email").focus();return false}if(document.getElementById("email").value!=document.getElementById("email1").value){alert("Your email and retype email does not match");document.getElementById("email1").focus();return false}if(document.getElementById("username").value.trim()==""){alert("Please enter username");document.getElementById("username").focus();return false}var b=document.getElementById("pass1").value;if(b.trim()==""){alert("Please enter password");document.getElementById("pass1").focus();return false}var a=document.getElementById("pass2").value;if(a.trim()==""){alert("Please enter retype password");document.getElementById("pass2").focus();return false}if(b!=""&&a!=""){if(b!=a){alert("password and retype password should be same");document.getElementById("pass2").focus();return false}}if(document.getElementById("gender").checked==false&&document.getElementById("gender1").checked==false){alert("Please select gender");document.getElementById("gender").focus();return false}if(document.getElementById("mm").value=="select"){alert("Please select month");document.getElementById("mm").focus();return false}if(document.getElementById("dd").value=="select"){alert("Please select date");document.getElementById("dd").focus();return false}if(document.getElementById("yy").value=="select"){alert("Please selet year");document.getElementById("yy").focus();return false}if(!dobCheck(e)){alert("You must be at least 13 years of age in order to access our site");document.getElementById("yy").focus();return false}var g=document.getElementById("country").value;if(g=="select"){alert("Please selet country");document.getElementById("country").focus();return false}if(document.getElementById("state").value.trim()==""){alert("Please select state");document.getElementById("state").focus();return false}if(document.getElementById("city").value.trim()==""){alert("Please select city");document.getElementById("city").focus();return false}var d=document.getElementById("zip").value;if(g=="226"||g=="37"){if(d.trim()==""){alert("Please enter zip");document.getElementById("zip").focus();return false}}if(g=="37"&&(d.length!=6||d.search(/^[a-zA-Z]{1}\d[a-zA-Z]{1}\d[a-zA-Z]{1}\d$/)==-1)){alert("Please enter valid zip");document.getElementById("zip").focus();return false}if(g=="226"&&(d.length!=5||checknumber(d)==false)){alert("Please enter valid zip");document.getElementById("zip").focus();return false}if(document.getElementById("profile_image1").value.trim()==""){if(document.getElementById("profile_picture").value.trim()==""){alert("Please upload profile picture");document.getElementById("profile_picture").focus();return false}}if(document.getElementById("profile_image1").value.trim()!=""){if(LimitAttach1(document.getElementById("profile_picture").value)==false){alert("Please only upload files that end in types: .jpg, .gif, .png");document.getElementById("profile_picture").focus();return false}}var f=document.getElementById("about_yourself").value;if(f.trim()==""||f=="Enter a short description about your business!"){alert("Please enter a short description about your business");document.getElementById("about_yourself").focus();return false}if(document.getElementById("industry").value.trim()==""){alert("Please select industry");document.getElementById("industry").focus();return false}if(document.getElementById("job_title").value.trim()==""){alert("Please select job title");document.getElementById("job_title").focus();return false}if(document.getElementById("company_size").value.trim()==""){alert("Please select company size");document.getElementById("company_size").focus();return false}if(document.getElementById("household_income").value.trim()==""){alert("Please select household income");document.getElementById("household_income").focus();return false}if(document.getElementById("apple_user_since").value.trim()==""){alert("Please select apple user since");document.getElementById("apple_user_since").focus();return false}}function PersonalInterest(a){if(document.getElementById("terms").checked==false){alert("Please read and agree with all terms of service!");document.getElementById("terms").focus();return false}}function CheckBusinessProfile(a){if(document.getElementById("terms").checked==false){alert("Please read and agree with all terms of service!");document.getElementById("terms").focus();return false}}function chk_register(e){var c=document.getElementById("email").value;if(c.trim()==""){alert("Please enter email");document.getElementById("email").focus();return false}if(c.trim()!=""&&emailCheck(c)==false){alert("Please enter valid email");document.getElementById("email").focus();return false}if(document.getElementById("email").value!=document.getElementById("email1").value){alert("Your email and retype email does not match");document.getElementById("email1").focus();return false}if(document.getElementById("username").value.trim()==""){alert("Please enter username");document.getElementById("username").focus();return false}var b=document.getElementById("pass1").value;if(b.trim()==""){alert("Please enter password");document.getElementById("pass1").focus();return false}var a=document.getElementById("pass2").value;if(a.trim()==""){alert("Please enter retype password");document.getElementById("pass2").focus();return false}if(b!=""&&a!=""){if(b!=a){alert("password and retype password should be same");document.getElementById("pass2").focus();return false}}if(document.getElementById("gender").checked==false&&document.getElementById("gender1").checked==false){alert("Please select gender");document.getElementById("gender").focus();return false}if(document.getElementById("mm").value=="select"){alert("Please select month");document.getElementById("mm").focus();return false}if(document.getElementById("dd").value=="select"){alert("Please select date");document.getElementById("dd").focus();return false}if(document.getElementById("yy").value=="select"){alert("Please selet year");document.getElementById("yy").focus();return false}if(!dobCheck(e)){alert("You must be at least 13 years of age in order to access our site");document.getElementById("yy").focus();return false}var g=document.getElementById("country").value;if(g=="select"){alert("Please selet country");document.getElementById("country").focus();return false}if(document.getElementById("state").value.trim()==""){alert("Please select state");document.getElementById("state").focus();return false}if(document.getElementById("city").value.trim()==""){alert("Please select city");document.getElementById("city").focus();return false}var d=document.getElementById("zip").value;if(g=="226"||g=="37"){if(d.trim()==""){alert("Please enter zip");document.getElementById("zip").focus();return false}}if(g=="37"&&(d.length!=6||d.search(/^[a-zA-Z]{1}\d[a-zA-Z]{1}\d[a-zA-Z]{1}\d$/)==-1)){alert("Please enter valid zip");document.getElementById("zip").focus();return false}if(g=="226"&&(d.length!=5||checknumber(d)==false)){alert("Please enter valid zip");document.getElementById("zip").focus();return false}if(document.getElementById("profile_image").value.trim()==""){if(document.getElementById("profile_picture").value.trim()==""){alert("Please upload profile picture");document.getElementById("profile_picture").focus();return false}}if(document.getElementById("profile_image").value.trim()!=""){if(LimitAttach1(document.getElementById("profile_picture").value)==false){alert("Please only upload files that end in types: .jpg, .gif, .png");document.getElementById("profile_picture").focus();return false}}var f=document.getElementById("about_yourself").value;if(f.trim()==""||f=="Enter a short description about yourself!"){alert("Please enter a short description about yourself");document.getElementById("about_yourself").focus();return false}if(document.getElementById("industry").value.trim()==""){alert("Please select industry");document.getElementById("industry").focus();return false}if(document.getElementById("job_title").value.trim()==""){alert("Please select job title");document.getElementById("job_title").focus();return false}if(document.getElementById("company_size").value.trim()==""){alert("Please select company size");document.getElementById("company_size").focus();return false}if(document.getElementById("household_income").value.trim()==""){alert("Please select household income");document.getElementById("household_income").focus();return false}if(document.getElementById("apple_user_since").value.trim()==""){alert("Please select apple user since");document.getElementById("apple_user_since").focus();return false}}function chk_AppleKnowledge(b){for(var a=0;a<document.frm.elements.length;a++){var c=document.frm.elements[a];if(c.type=="radio"){if(c.checked=false){alert("Please select value of")}}}}function dobCheck(e){var a=parseInt(e.dd.value);var b=parseInt(e.mm.value);var d=parseInt(e.yy.value);var c=new Date();var f=Array();f[0]=c.getDate();f[1]=(c.getMonth()+1);f[2]=c.getFullYear();if(d>=f[2]){return false}else{if(f[2]<(d+Number(13))){return false}}return true}function chk_login(){if(document.getElementById("username").value.trim()==""){alert("Please Enter Username");return false}if(document.getElementById("password").value.trim()==""){alert("Please Enter Password");return false}}function chk_uploadLogin(){if(document.getElementById("username").value.trim()==""){alert("Please Enter Username");return false}if(document.getElementById("password").value.trim()==""){alert("Please Enter Password");return false}}function emailCheck(b){var s=/^(.+)@(.+)$/;var q='\\(\\)<>@,;:\\\\\\"\\.\\[\\]';var k="[^\\s"+q+"]";var d='("[^"]*")';var r=/^\[(\d)\.(\d)\.(\d)\.(\d)\]$/;var a=k+"+";var p="("+a+"|"+d+")";var l=new RegExp("^"+p+"(\\."+p+")*$");var f=new RegExp("^"+a+"(\\."+a+")*$");var c=b.match(s);if(c==null){return false}var t=c[1];var u=c[2];if(t.match(l)==null){return false}var j=u.match(r);if(j!=null){for(var m=1;m<=4;m++){if(j[m]>255){return false}}return true}var g=u.match(f);if(g==null){return false}var h=new RegExp(a,"g");var e=u.match(h);var o=e.length;if(e[e.length-1].length<2||e[e.length-1].length>3){return false}if(o<2){return false}return true}function show_appleKnowledge(){document.getElementById("apple_knowledge").style.display="";document.getElementById("hide_apple").style.display="";document.getElementById("show_apple").style.display="none"}function hide_appleKnowledge(){document.getElementById("apple_knowledge").style.display="none";document.getElementById("hide_apple").style.display="none";document.getElementById("show_apple").style.display=""}function show_physicalAttributes(){document.getElementById("physical_attributes").style.display="";document.getElementById("hide_physical").style.display="";document.getElementById("show_physical").style.display="none"}function hide_physicalAttributes(){document.getElementById("physical_attributes").style.display="none";document.getElementById("hide_physical").style.display="none";document.getElementById("show_physical").style.display=""}function show_favoriteActivities(){document.getElementById("favorite_activities").style.display="";document.getElementById("hide_favorite").style.display="";document.getElementById("show_favorite").style.display="none"}function hide_favoriteActivities(){document.getElementById("favorite_activities").style.display="none";document.getElementById("hide_favorite").style.display="none";document.getElementById("show_favorite").style.display=""}function chk_editProfile(){var c=document.getElementById("email").value;var f=document.getElementById("ReEmail").value;if(c.trim()==""){alert("Please Enter Email");return false}if(c.trim()!=""&&emailCheck(c)==false){alert("Please Enter Valid Email");return false}if(f.trim()==""){alert("Please Enter Re-Type Email");return false}if(f.trim()!=""&&emailCheck(f)==false){alert("Please Enter Valid Re-Type Email");return false}if(c.trim()!=f.trim()){alert("Email and Re-Type Email Should Be Same");return false}if(document.getElementById("username").value.trim()==""){alert("Please Enter User Name");return false}var b=document.getElementById("password").value;if(b.trim()==""){alert("Please Enter Password");return false}var a=document.getElementById("retype_password").value;if(a.trim()==""){alert("Please Enter Retype Password");return false}if(b!=""&&a!=""){if(b!=a){alert("Password and Retype Password Should Be Same");return false}}if(document.getElementById("mm").value=="select"){alert("Please Select Month");return false}if(document.getElementById("dd").value=="select"){alert("Please Select Date");return false}if(document.getElementById("yy").value=="select"){alert("Please Selet Year");return false}if(document.getElementById("user_picture").value.trim()!=""){if(LimitAttach1(document.getElementById("user_picture").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}var e=document.getElementById("AccountCountry").value;if(e=="select"){alert("Please Selet Country");return false}if(document.getElementById("AccountState").value.trim()==""){alert("Please Select State");return false}if(document.getElementById("AccountCity").value.trim()==""){alert("Please Select City");return false}var d=document.getElementById("zip").value;if(e=="226"||e=="37"){if(d.trim()==""){alert("Please Enter Zip");return false}}if(e=="37"&&(d.length!=6||d.search(/^[a-zA-Z]{1}\d[a-zA-Z]{1}\d[a-zA-Z]{1}\d$/)==-1)){alert("Please Enter Valid Zip");return false}if(e=="226"&&(d.length!=5||checknumber(d)==false)){alert("Please Enter Valid Zip");return false}if(document.getElementById("apple_user_since").value.trim()==""){alert("Please Select Apple User Since");return false}}function rate_appleProduct(a,b){document.myProfile.action="index.php?option=com_account&task=rating";document.myProfile.submit()}function show_broadcast(){document.getElementById("borad_cast").style.display="";document.getElementById("broadcast_close").style.display="";document.getElementById("broadcast_show").style.display="none";document.getElementById("broadcast_private").style.display="none";document.getElementById("broadcast_public").style.display="none"}function hide_broadcast(){document.getElementById("borad_cast").style.display="none";document.getElementById("broadcast_close").style.display="none";document.getElementById("broadcast_show").style.display="";var a=document.getElementById("broadcast2").checked;if(a==true){document.getElementById("broadcast_private").style.display="";document.getElementById("broadcast_public").style.display="none"}else{document.getElementById("broadcast_private").style.display="none";document.getElementById("broadcast_public").style.display=""}}function date_show(){document.getElementById("date_recorded").style.display="";document.getElementById("date_hide").style.display="";document.getElementById("date_show").style.display="none";document.getElementById("date_default").style.display="none";document.getElementById("date_set").style.display="none"}function date_hide(){document.getElementById("date_recorded").style.display="none";document.getElementById("date_hide").style.display="none";document.getElementById("date_show").style.display="";if(document.getElementById("dd").value!=0&&document.getElementById("mm").value!=0&&document.getElementById("yy").value!=0){document.getElementById("date_default").style.display="none";document.getElementById("date_set").style.display=""}else{document.getElementById("date_default").style.display="";document.getElementById("date_set").style.display="none"}}function set_calendarDate(){alert("i m here");var b=new Date();var f=b.getMonth()+1;var a=b.getDate();var d=b.getFullYear();var e=document.event_step2;e.dd[a].selected=true;e.mm[f].selected=true;for(var c=0;c<e.yy.length;c++){if(e.yy[c].value==d){e.yy[c].selected=true}}return true}function set_today(){var b=new Date();var f=b.getMonth()+1;var a=b.getDate();var d=b.getFullYear();var e=document.upload_step2;e.dd[a].selected=true;e.mm[f].selected=true;for(var c=0;c<e.yy.length;c++){if(e.yy[c].value==d){e.yy[c].selected=true}}return true}function clear_date(){var a=document.upload_step2;a.dd[0].selected=true;a.mm[0].selected=true;a.yy[0].selected=true}function sharing_show(){document.getElementById("sharing_option").style.display="";document.getElementById("sharing_hide").style.display="";document.getElementById("sharing_show").style.display="none";document.getElementById("sharing_default").style.display="none"}function sharing_hide(){document.getElementById("sharing_option").style.display="none";document.getElementById("sharing_hide").style.display="none";document.getElementById("sharing_show").style.display="";document.getElementById("sharing_default").style.display=""}function chk_uploadStpe2(){if(document.getElementById("title").value.trim()==""){alert("Please Enter Title");return false}var a=document.getElementById("description").value;if(a.trim()==""){alert("Please Enter Description");return false}if(a.trim()!=""){if(a.length<25){alert("Please enter description containing at least 25 characters");return false}}if(document.getElementById("tags").value.trim()==""){alert("Please Enter Tags");return false}if(document.getElementById("tags").value.trim()==""){alert("Please Enter Tags");return false}if(getChkCount("category")==0){alert("Please Select Atleast One Category");return false}}function getChkCount(b){f1=document.upload_step2;var c=0;for(i=0;i<f1.length;i++){var a=f1[i].name;if(a.indexOf(b)>=0&&f1[i].type=="checkbox"&&f1[i].checked==true){c++}}return c}var freeItemCount=0;var maxFreeItems=3;function setItems(a){if(a.checked){freeItemCount=freeItemCount+1}else{freeItemCount=freeItemCount-1}if(freeItemCount>maxFreeItems){a.checked=false;freeItemCount=freeItemCount-1;alert("You Can Only Select a Maximum of "+maxFreeItems+" Categories")}}function open_trouble(){window.open("trouble_uploading.htm","Trouble Uploading","width=500,height=300,resizable=no,scrollbars=yes,status=no,menubar=no,toolbar=no,directories=no,left=200,top=150,screenX=0,screenY=100")}function chk_uploadStpe3(){var a=document.getElementById("file_type").value;if(a=="video"){if(document.getElementById("video_file").value.trim()==""){alert("Please Video Upload File");return false}if(document.getElementById("video_file").value.trim()!=""){if(LimitAttach(document.getElementById("video_file").value)==false){alert("Please Only Upload Files That End In Types: .avi, .dat, .mpeg, .wmv, .mov");return false}}}else{if(a=="picture"){if(document.getElementById("picture_file1").value.trim()==""&&document.getElementById("picture_file2").value.trim()==""&&document.getElementById("picture_file3").value.trim()==""&&document.getElementById("picture_file4").value.trim()==""&&document.getElementById("picture_file5").value.trim()==""){alert("Please Upload Atleast One Picture");return false}if(document.getElementById("picture_file1").value.trim()!=""){if(LimitAttach1(document.getElementById("picture_file1").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}if(document.getElementById("picture_file2").value.trim()!=""){if(LimitAttach1(document.getElementById("picture_file2").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}if(document.getElementById("picture_file3").value.trim()!=""){if(LimitAttach1(document.getElementById("picture_file3").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}if(document.getElementById("picture_file4").value.trim()!=""){if(LimitAttach1(document.getElementById("picture_file4").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}if(document.getElementById("picture_file5").value.trim()!=""){if(LimitAttach1(document.getElementById("picture_file5").value)==false){alert("Please Only Upload Files That End In Types: .jpg, .gif, .png");return false}}}}if(document.getElementById("HelpingHand").checked==true){if(document.getElementById("HelpingWebAddress").value.trim()==""){alert("Please enter website address");document.getElementById("HelpingWebAddress").focus();return false}if(document.getElementById("HelpingWebAddress").value.trim()!=""){if(isValidURL(document.getElementById("HelpingWebAddress").value)==false){alert("Please enter valid website address");document.getElementById("HelpingWebAddress").focus();return false}}}document.getElementById("upload").disabled="true";hidden_span=document.getElementById("hide_stuff");hidden_span.style.display="block";return true}extArray=new Array(".avi",".dat",".mpeg",".wmv",".mov",".mp4",".AVI",".DAT",".MPEG",".WMV",".MOV",".MP4",".MPG",".mpg");function LimitAttach(b){allowSubmit=false;if(!b){return}while(b.indexOf("\\")!=-1){b=b.slice(b.indexOf("\\")+1)}ext=b.slice(b.indexOf(".")).toLowerCase();for(var a=0;a<extArray.length;a++){if(extArray[a]==ext){allowSubmit=true;break}}if(allowSubmit){return true}else{return false}}extArray1=new Array(".gif",".jpg",".jpeg",".png",".GIF",".JPG",".PNG",".JPEG",".bmp",".BMP");function LimitAttach1(b){allowSubmit=false;if(!b){return}while(b.indexOf("\\")!=-1){b=b.slice(b.indexOf("\\")+1)}ext=b.slice(b.indexOf(".")).toLowerCase();for(var a=0;a<extArray1.length;a++){if(extArray1[a]==ext){allowSubmit=true;break}}if(allowSubmit){return true}else{return false}}function edit_video(a,b){window.location.href="http://www.macdirectory.com/component/option,com_files/task,editVideo/vid,"+a+"/next,"+b+"/"}function delete_video(a,b){if(confirm("Are you sure you want to delete this file?")){window.location.href="http://www.macdirectory.com/component/option,com_files/task,deleteVideo/vid,"+a+"/next,"+b+"/";return true}else{return false}}function validate_editVideo(){if(document.getElementById("title").value.trim()==""){alert("Please enter title");return false}if(document.getElementById("description").value.trim()==""){alert("Please enter description");return false}if(document.getElementById("tags").value.trim()==""){alert("Please enter tags");return false}if(document.getElementById("tags").value.trim()==""){alert("Please enter tags");return false}if(getChkCount1("category")==0){alert("Please select atleast one category");return false}if(document.getElementById("mm").value==0){alert("Please select recorded month");return false}if(document.getElementById("dd").value==0){alert("Please select recorded date");return false}if(document.getElementById("yy").value==0){alert("Please select recorded year");return false}if(document.getElementById("video_file").value.trim()!=""){if(LimitAttach(document.getElementById("video_file").value)==false){alert("Please only upload files that ends in types: .avi, .dat, .mpeg, .wmv, .mov");return false}}document.getElementById("update_btn").disabled="true";hidden_span=document.getElementById("hide_stuff");hidden_span.style.display="block";return true}function getChkCount1(b){f1=document.edit_video;var c=0;for(i=0;i<f1.length;i++){var a=f1[i].name;if(a.indexOf(b)>=0&&f1[i].type=="checkbox"&&f1[i].checked==true){c++}}return c}var freeItemCount1=0;var maxFreeItems1=3;function setItems1(a){if(a.checked){freeItemCount1=freeItemCount1+1}else{freeItemCount1=freeItemCount1-1}if(freeItemCount1>maxFreeItems1){a.checked=false;freeItemCount1=freeItemCount1-1;alert("You can only select a maximum of "+maxFreeItems1+" categories")}}function view_moreInfo(){document.getElementById("moreinfo_link").style.display="none";document.getElementById("lessinfo_link").style.display="";document.getElementById("less_info").style.display="none";document.getElementById("more_info").style.display=""}function view_lessInfo(){document.getElementById("moreinfo_link").style.display="";document.getElementById("lessinfo_link").style.display="none";document.getElementById("less_info").style.display="";document.getElementById("more_info").style.display="none"}function edit_photo(a,b){window.location.href="http://www.macdirectory.com/component/option,com_files/task,editPhoto/aid,"+a+"/next,"+b+"/"}function delete_photo(a,b){if(confirm("Are you sure you want to delete this file?")){window.location.href="http://www.macdirectory.com/component/option,com_files/task,deletePhoto/aid,"+a+"/next,"+b+"/";return true}else{return false}}function validate_editPhoto(){if(document.getElementById("title").value.trim()==""){alert("Please enter title");return false}if(document.getElementById("description").value.trim()==""){alert("Please enter description");return false}if(document.getElementById("tags").value.trim()==""){alert("Please enter tags");return false}if(document.getElementById("tags").value.trim()==""){alert("Please enter tags");return false}if(getChkCount1("category")==0){alert("Please select atleast one category");return false}if(document.getElementById("mm").value==0){alert("Please select recorded month");return false}if(document.getElementById("dd").value==0){alert("Please select recorded date");return false}if(document.getElementById("yy").value==0){alert("Please select recorder year");return false}document.getElementById("update_btn").disabled="true";hidden_span=document.getElementById("hide_stuff");hidden_span.style.display="block";return false}function show_videoToolbar(){document.getElementById("img_video1").style.display="none";document.getElementById("img_video2").style.display="";document.getElementById("link_video1").style.display="none";document.getElementById("link_video2").style.display="";document.getElementById("video_toolbar").style.display=""}function hide_videoToolbar(){document.getElementById("img_video1").style.display="";document.getElementById("img_video2").style.display="none";document.getElementById("link_video1").style.display="";document.getElementById("link_video2").style.display="none";document.getElementById("video_toolbar").style.display="none"}function show_videoToolbar1(){document.getElementById("img_video11").style.display="none";document.getElementById("img_video21").style.display="";document.getElementById("link_video11").style.display="none";document.getElementById("link_video21").style.display="";document.getElementById("video_toolbar1").style.display=""}function hide_videoToolbar1(){document.getElementById("img_video11").style.display="";document.getElementById("img_video21").style.display="none";document.getElementById("link_video11").style.display="";document.getElementById("link_video21").style.display="none";document.getElementById("video_toolbar1").style.display="none"}function show_photoToolbar(){document.getElementById("img_photo1").style.display="none";document.getElementById("img_photo2").style.display="";document.getElementById("link_photo1").style.display="none";document.getElementById("link_photo2").style.display="";document.getElementById("photo_toolbar").style.display=""}function hide_photoToolbar(){document.getElementById("img_photo1").style.display="";document.getElementById("img_photo2").style.display="none";document.getElementById("link_photo1").style.display="";document.getElementById("link_photo2").style.display="none";document.getElementById("photo_toolbar").style.display="none"}function show_memberToolbar(){document.getElementById("img_member1").style.display="none";document.getElementById("img_member2").style.display="";document.getElementById("link_member1").style.display="none";document.getElementById("link_member2").style.display="";document.getElementById("member_toolbar").style.display=""}function hide_memberToolbar(){document.getElementById("img_member1").style.display="";document.getElementById("img_member2").style.display="none";document.getElementById("link_member1").style.display="";document.getElementById("link_member2").style.display="none";document.getElementById("member_toolbar").style.display="none"}function view_relatedVideos(){document.getElementById("view_Related").style.display="none";document.getElementById("hide_Related").style.display="";document.getElementById("related_videos").style.display=""}function hide_relatedVideos(){document.getElementById("view_Related").style.display="";document.getElementById("hide_Related").style.display="none";document.getElementById("related_videos").style.display="none"}function chk_video_comments(){if(document.getElementById("videoComments").value.trim()==""){alert("Please enter comment");return false}}function view_comments(a){window.location.href="http://www.macdirectory.com/component/option,com_file1/task,videoAllComments/vid,"+a+"/"}function show_videoCommentReply(b){var c="video_comment_reply_"+b;var a="commment_reply_"+b;document.getElementById(c).style.display="";document.getElementById(a).style.display="none"}function chk_vdoCommentReply(a){var b="reply_text_"+a;if(document.getElementById(b).value.trim()==""){alert("Please enter your comment reply");return false}}function post_VdoComment(a){document.getElementById("link_postComment").style.display="none";document.getElementById("new_vdoComment").style.display=""}function chk_postVdoComment(){if(document.getElementById("comment_txt").value.trim()==""){alert("Please enter comment");return false}}function view_relatedvdo_detail(){document.getElementById("related_videoDetail").style.display="";document.getElementById("related_videoBasic").style.display="none"}function view_relatedvdo_basic(){document.getElementById("related_videoDetail").style.display="none";document.getElementById("related_videoBasic").style.display=""}function view_morevdo_detail(){document.getElementById("more_videoDetail").style.display="";document.getElementById("more_videoBasic").style.display="none"}function view_morevdo_basic(){document.getElementById("more_videoDetail").style.display="none";document.getElementById("more_videoBasic").style.display=""}function chk_shareVideo(){if(document.getElementById("vdo_emails").value.trim()==""){alert("Please enter atleast one email");return false}}function cancel_shareVideo(a){window.location.href="http://www.macdirectory.com/component/option,com_files/task,viewVideo/id,"+a+"/"}function chk_sharePhoto(){if(document.getElementById("ph_emails").value.trim()==""){alert("Please enter atleast one email");return false}}function cancel_sharePh0to(a){window.location.href="http://www.macdirectory.com/component/option,com_files/task,viewPhoto/id,"+a+"/"}function chk_photo_comments(){if(document.getElementById("photoComments").value.trim()==""){alert("Please enter commments");return false}}function view_photo_comments(a){window.location.href="http://www.macdirectory.com/component/option,com_file1/task,photoAllComments/pid,"+a+"/"}function check_search(a){}function show_videoFlag(){document.getElementById("vdo_flg").style.display="none";document.getElementById("vdo_flg1").style.display="";document.getElementById("video_flag").style.display=""}function close_videoFlag(){document.getElementById("vdo_flg").style.display="";document.getElementById("vdo_flg1").style.display="none";document.getElementById("video_flag").style.display="none"}function show_alreadyVideoFlag(){document.getElementById("already_vdo_flag").style.display=""}function view_usersAccountInfo(){document.getElementById("Users_Account_Info").style.display="";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_Subscribers").style.display="none";document.getElementById("Users_History").style.display="none"}function view_userProfile(){document.getElementById("Users_Account_Info").style.display="";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userVideos(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userPhotos(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userFavorites(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userFriends(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userPlaylist(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userSubscriptions(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display="none"}function view_userSubscribers(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Users_Subscribers").style.display=""}function viewSubscriptionDetails(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_Subscribers").style.display="none";document.getElementById("Users_History").style.display="none";document.getElementById("Edit_Subscriptions").style.display=""}function view_userHistory(){document.getElementById("Users_Account_Info").style.display="none";document.getElementById("Users_Video").style.display="none";document.getElementById("Users_Photo").style.display="none";document.getElementById("Users_Favorites").style.display="none";document.getElementById("Users_Friends").style.display="none";document.getElementById("Users_Playlist").style.display="none";document.getElementById("Users_Subscriptions").style.display="none";document.getElementById("Users_Subscribers").style.display="none";document.getElementById("Users_History").style.display="";document.getElementById("Edit_Subscriptions").style.display="none"}function user_addFavorites(a){window.location.href="http://www.macdirectory.com/component/option,com_login/task,addFavorite/to_user,"+a+"/"}function user_addFriend(a){window.location.href="http://www.macdirectory.com/component/option,com_login/task,addFriend/to_user,"+a+"/"}function user_sendMessage(a){window.location.href="http://www.macdirectory.com/component/option,com_login/task,message/to_user,"+a+"/"}function check_message(){if(document.getElementById("subject").value.trim()==""){alert("Please enter subject");return false}if(document.getElementById("message").value.trim()==""){alert("Please enter message");return false}}function chk_videoArchive(){if(document.getElementById("from_date").value==""){alert("Please select from date");return false}if(document.getElementById("to_date").value==""){alert("Please select to date");return false}}function show_playlist(){document.getElementById("add_playlist").style.display="";document.getElementById("vdo_play").style.display="none";document.getElementById("vdo_play1").style.display=""}function close_playlist(){document.getElementById("add_playlist").style.display="none";document.getElementById("vdo_play").style.display="";document.getElementById("vdo_play1").style.display="none"}function chk_vdoPlaylist(){var a=document.getElementById("videoId").value;if(document.getElementById("vdo_playlist").value=="select"){alert("Please select a playlist");return false}else{if(document.getElementById("vdo_playlist").value=="new_vdo_play_list"){window.location.href="http://www.macdirectory.com/component/option,com_playlist/task,new_vdoPlaylist/add_video,"+a+"/"}}return true}function check_new_vdoPlaylist(){if(document.getElementById("playlist_name").value.trim()==""){alert("Please enter playlist name");return false}if(document.getElementById("description").value.trim()==""){alert("Please enter description");return false}}function show_vdo_customize(){document.getElementById("vdo_customize").style.display="none";document.getElementById("vdo_customize1").style.display="";document.getElementById("customize_video").style.display=""}function hide_vdo_customize(){document.getElementById("vdo_customize").style.display="";document.getElementById("vdo_customize1").style.display="none";document.getElementById("customize_video").style.display="none"}function remove_favorite(a){window.location.href="http://www.macdirectory.com/component/option,com_favorites/task,remove_favorite/fav_id,"+a+"/"}function customize_embed_player(c){var b=document.getElementById("site_url").value;var d=document.getElementById("flv_filename").value;switch(c){case"red":back_color="0x5d1719";front_color="0xFFFFFF";light_color="0xcd311b";break;case"purple":back_color="0x402061";front_color="0xFFFFFF";light_color="0x9461ca";break;case"blue":back_color="0x006699";front_color="0xFFFFFF";light_color="0x54abd6";break;case"grey":back_color="0xd6d6d6";front_color="0x333333";light_color="0xf0f0f0";break;case"orange":back_color="0xe1600f";front_color="0xFFFFFF";light_color="0xfebd01";break;case"pink":back_color="0xcc2550";front_color="0xFFFFFF";light_color="0xe87a9f";break;case"green":back_color="0x234900";front_color="0xFFFFFF";light_color="0x4e9e00";break;case"blue_drk":back_color="0x2b405b";front_color="0xFFFFFF";light_color="0x6b8ab6";break}var a='<object type="application/x-shockwave-flash" width="490" height="383" wmode="transparent" data="'+b+"/playerflv/flvplayer.swf?file="+b+"/"+d+"&autoStart=true&backcolor="+back_color+"&frontcolor="+front_color+"&lightcolor="+light_color+'"><param name="movie" value="'+b+"/playerflv/flvplayer.swf?file="+b+"/"+d+"&autoStart=true&backcolor="+back_color+"&frontcolor="+front_color+"&lightcolor="+light_color+'"/><param name="wmode" value="transparent"/></object>';document.getElementById("embed_code").value=a}function chk_photoPlaylist(){var a=document.getElementById("albumId").value;if(document.getElementById("ph_playlist").value=="select"){alert("Please select a playlist");return false}else{if(document.getElementById("ph_playlist").value=="new_ph_play_list"){window.location.href="http://www.macdirectory.com/component/option,com_playlist/task,new_ph_Playlist/add_album,"+a+"/"}}return true}function check_invitation(){if(document.getElementById("message").value.trim()==""){alert("Please enter message");return false}}function reject_friend(a){window.location.href="http://www.macdirectory.com/component/option,com_friends/task,rejectFriend/friendId,"+a+"/"}function approve_friend(a){window.location.href="http://www.macdirectory.com/component/option,com_friends/task,approveFriend/friendId,"+a+"/"}function delete_friend(a){window.location.href="http://www.macdirectory.com/component/option,com_friends/task,deleteFriend/friendId,"+a+"/"}function check_playlist(){var d=document.getElementById("email_addr1").value;var c=document.getElementById("email_addr2").value;var b=document.getElementById("email_addr3").value;var a=document.getElementById("email_addr4").value;if(d==""&&c==""&&b==""&a==""){alert("Please enter atleast one email address");return false}if(d!=""){if(emailCheck(d)==false){alert("Please enter valid email address");return false}}if(c!=""){if(emailCheck(c)==false){alert("Please enter valid email address");return false}}if(b!=""){if(emailCheck(b)==false){alert("Please enter valid email address");return false}}if(a!=""){if(emailCheck(a)==false){alert("Please enter valid email address");return false}}}function show_sub_allVideo(){document.getElementById("show_video").style.display="";document.getElementById("show_photos").style.display="none"}function show_sub_allPhoto(){document.getElementById("show_video").style.display="none";document.getElementById("show_photos").style.display=""}function chk_forgotPassword(){if(document.getElementById("username").value.trim()==""){alert("Please enter username");return false}if(document.getElementById("email_id").value.trim()==""){alert("Please enter email ID");return false}if(document.getElementById("email_id").value.trim()!=""){if(emailCheck(document.getElementById("email_id").value)==false){alert("Please enter valid email ID");return false}}}function chk_unsubscribe_email(){if(document.getElementById("email").value.trim()==""){alert("Please enter email ID");return false}if(document.getElementById("email").value.trim()!=""){if(emailCheck(document.getElementById("email").value)==false){alert("Please enter valid email ID");return false}}}

function OpenWin(c,e,b,a){var f="'toolbar=no,location=no,directories=no,status=no,scrollbars="+a+", menubar=no,marginwidth=0,marginheight=0,resizable=no,width="+e+",height="+b+"'";var d=window.open('http://www.macdirectory.com/'+c,"",f)


}function OpenNewsletterWin(a){var b=window.open(a)}function vdoDescription(a){window.open("video_desc.php?id="+a,"mywindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,width=400,height=300")}function phDescription(a){window.open("photo_desc.php?id="+a,"mywindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,width=400,height=300")}function phChnDescription(a){window.open("photo_channels.php?id="+a,"mywindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,width=400,height=300")}function memDescription(a){window.open("mem_desc.php?id="+a,"mywindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,width=400,height=300")}function chk_video_email(){if(document.getElementById("your_name").value.trim()==""){alert("Please enter your name");return false}if(document.getElementById("your_email").value.trim()==""){alert("Please enter your email");return false}if(document.getElementById("your_email").value.trim()!=""){if(emailCheck(document.getElementById("your_email").value)==false){alert("Please enter valid your email");return false}}if(document.getElementById("message").value.trim()==""){alert("Please Enter Your Message");return false}}function cancel_video_email(a){window.location.href="http://www.macdirectory.com/component/option,com_files/task,viewVideo/id,"+a+"/"}function cancel_user_email(a){window.location.href="http://www.macdirectory.com/component/option,com_search_mem/task,detailPosted/cond,all/"}function showStars(a){if(a==1){text_disp="Terrible!"}if(a==2){text_disp="Nothing special"}if(a==3){text_disp="Good"}if(a==4){text_disp="Excellent"}if(a==5){text_disp="Amazing!"}document.getElementById("defaultRatingMessage").innerHTML=text_disp}function clearStars(){document.getElementById("defaultRatingMessage").innerHTML=""}function checkAll(b,a){if(document.getElementById("checkallbox").checked==true){for(i=0,n=b.elements.length;i<n;i++){if(b.elements[i].name=="check[]"){if(b.elements[i].checked==true){b.elements[i].checked=true}else{b.elements[i].checked=true}}}}else{for(i=0,n=b.elements.length;i<n;i++){if(b.elements[i].name=="check[]"){if(b.elements[i].checked==true){b.elements[i].checked=false}else{b.elements[i].checked=false}}}}}function check_checkbox(d,c){var b=1;for(i=0,n=d.elements.length;i<n;i++){if(d.elements[i].name==c){if(d.elements[i].checked==true){b=0}}}if(b==1){alert("Please select atleast one check box");return false}var a=1;for(i=0,n=d.elements.length;i<n;i++){if(d.elements[i].name==c){if(d.elements[i].checked==true){a++}}}if(confirm("Permanently delete this message(s)?")){return true}else{return false}}function delMessage(){if(confirm("Permanently delete this message?")){return true}else{return false}}function addPhotos(){var a=document.getElementById("div_userPics");var b=(document.getElementById("num_pics").value-1)+2;document.getElementById("num_pics").value=b;if(b<=50){var c=document.createElement("div");var d="div_userPic_"+b;c.setAttribute("id",d);c.setAttribute("style","padding-top:10px;");c.innerHTML="<input type='file'  name='picture_file[]' size='35'>&nbsp;&nbsp;&nbsp;&nbsp;Photo description: <input type='text' id='Credit[]' name='Credit[]' size='45' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='padding-left:5px;color:#FF0000'><a href='javascript:delete_userPics("+b+")' class='blue-link11'>Remove</a></span>";a.appendChild(c)}}function delete_userPics(b){var c=document.getElementById("div_userPics");var d=document.getElementById("num_pics").value;var a=document.getElementById("div_userPic_"+b);c.removeChild(a);document.getElementById("num_pics").value=d-1}function showProofLink(){document.getElementById("proofTR").style.display=""}function showProof(){document.getElementById("copyrightTR").style.display=""}function hideProofLink(){document.getElementById("proofTR").style.display="none";document.getElementById("copyrightTR").style.display="none"}function delMessage1(a){if(confirm("Permanently delete this message?")){window.location.href="http://www.macdirectory.com/component/option,com_message/task,delete/messageId,"+a+"/";return true}}function viewReplyButton(){document.getElementById("reply").style.display="none";document.getElementById("reply1").style.display="";document.getElementById("message").focus()}function ShowHelpingHandUrl(){document.getElementById("HelpingHandTr").style.display=""}function HideHelpingHandUrl(){document.getElementById("HelpingHandTr").style.display="none"}function CheckVideoFlag(){if(document.getElementById("flag_reason").value==""){alert("Please select a reason");return false}}function createXMLHttpRequest(){var a;if(window.XMLHttpRequest){try{a=new XMLHttpRequest()}catch(b){a=false}}else{if(window.ActiveXObject){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=false}}}return a}var AccountReq=createXMLHttpRequest();function GetAccountState(){var a=document.getElementById("AccountCountry").value;if(a!=""){AccountReq.open("get","AccountStates.php?CountryId="+a);AccountReq.onreadystatechange=AccountStateHandleResponse;AccountReq.send(null)}}function AccountStateHandleResponse(){if(AccountReq.readyState==4){var a=AccountReq.responseText;document.getElementById("AccountState").innerHTML=a;GetAccountCity()}}var AccountReq1=createXMLHttpRequest();function GetAccountCity(){var a=document.getElementById("AccountState").value;if(a!=""){AccountReq1.open("get","AccountCity.php?StateId="+a);AccountReq1.onreadystatechange=AccountCityHandleResponse;AccountReq1.send(null)}}function AccountCityHandleResponse(){if(AccountReq1.readyState==4){var a=AccountReq1.responseText;document.getElementById("AccountCity").innerHTML=a}}function CheckRegisterCity(){if(document.getElementById("city").value=="Other"){document.getElementById("OtherCityTr").style.display=""}else{document.getElementById("OtherCityTr").style.display="none"}}function CheckAccountCity(){if(document.getElementById("AccountCity").value=="Other"){document.getElementById("OtherCityTr").style.display=""}else{document.getElementById("OtherCityTr").style.display="none"}}function CheckAll(a){for(var b=0;b<document.frm.elements.length;b++){var c=document.frm.elements[b];if(c.type=="checkbox"){c.checked=true}if(document.getElementById("SmartShopper").checked==true){document.getElementById("SmartShopper").checked=false}if(document.getElementById("emacweekly").checked==true){document.getElementById("emacweekly").checked=false}if(document.getElementById("emacmonthly").checked==true){document.getElementById("emacmonthly").checked=false}}}function chk_writersStpe2(){if(document.getElementById("fullname").value.trim()==""){alert("Please Enter full name");return false}var a=document.getElementById("description").value;if(a.trim()==""){alert("Please Enter Description");return false}if(a.trim()!=""){if(a.length<25){alert("Please enter description containing at least 25 characters");return false}}if(document.getElementById("since").value.trim()==""){alert("Please Enter writer since");return false}if(getChkCount("category")==0){alert("Please Select Atleast One Category");return false}if(document.getElementById("writer_image").value.trim()==""&&document.getElementById("")==""){alert("Please Upload profile image");return false}};
