// JavaScript Document






/*/*//////////////////////////////////////////////////////////////////////////////////////////////
/*/*//////////////////////////////////////////////////////////////////////////////////////////////
/*/*//////////////
/*/*////////////// Custom Calls
/*/*//////////////
/*/*//////////////////////////////////////////////////////////////////////////////////////////////
/*/*//////////////////////////////////////////////////////////////////////////////////////////////

$(document).ready(function(){
						   $(".sreslut, .memberDiscript, .memberDiscript2").css({
                opacity: .99
            }).fadeIn();	   
						    
   		$(".Divan select").change(function () {
          var str = "";
          $(".Divan select option:selected").each(function () {
                str += $(".Divan select option:selected").val();
              });
		  if (str != ''){
			  $(".sreslut").show();
			  $(".sreslut").not("."+str+"").hide();
			  return false;
		  }else if ($(".sreslut").css("display") == "none") { 
		  		$(".sreslut").hide();
				$(".sreslut").not("."+str+"").show();
				return false;
			  }
		  
          
        })
        .trigger('change');		
	
});
(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}

			fx.elem.style[attr] = "rgb(" + [
				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
			].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
	
	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break; 

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};
	
	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};
	
})(jQuery);



$(document).ready(function() {   
//Grab the original BG color of the link
var originalBG = $(".FADEevent").css("background-color"); 
//The color you want to fade too
var fadeColor = "#f6eacb"; 

//Now animate on links with class = animate
$("li.FADEevent").hover( 
	function() { 
		$(this)
			//Fade to the new color
			.animate({backgroundColor:fadeColor}, 50)

		}, 
	function(){
			$(this)			//Fade back to original color
			.animate({backgroundColor:originalBG},50) 
		}
	); 
}); 




/*
JQuery File Upload Plugin v1.5.0 by RonnieSan
Copyright (C) 2009  Ronnie Garcia
Upload Speed added by Travis Nichols

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
	if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
		var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
		var descArray = flashDescription.split(" ");
		var tempArrayMajor = descArray[2].split(".");			
		var versionMajor = tempArrayMajor[0];
		var versionMinor = tempArrayMajor[1];
		var versionRevision = descArray[3];
		if (versionRevision == "") {
			versionRevision = descArray[4];
		}
		if (versionRevision[0] == "d") {
			versionRevision = versionRevision.substring(1);
		} else if (versionRevision[0] == "r") {
			versionRevision = versionRevision.substring(1);
			if (versionRevision.indexOf("d") > 0) {
				versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
			}
		}
		var flashVer = versionMajor + "." + versionMinor	 + "." + versionRevision;
	}
}
else if ( $.browser.msie ) {
	var version;
	var axo;
	var e;
	try {
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}	
	flashVer = version.replace("WIN ","").replace(",",".");
}
flashVer = flashVer.split(".")[0];

if(jQuery)(
	function($){
		$.extend($.fn,{
			fileUpload:function(options) {
				if (flashVer >= 9) {
					$(this).each(function(){
						settings = $.extend({
							uploader:      'uploader.swf',
							script:        'uploader.php',
							folder:        '',
							height:        30,
							width:         110,
							cancelImg:     'cancel.png',
							wmode:         'opaque',
							scriptAccess:  'sameDomain',
							onInit:        function() {},
							onSelect:      function() {},
							onCancel:      function() {},
							onError:       function() {},
							onProgress:    function() {},
							onComplete:    function() {}
						}, options);
						var pagePath = location.pathname;
						pagePath = pagePath.split('/');
						pagePath.pop();
						pagePath = pagePath.join('/') + '/';
						var data = '&pagepath=' + pagePath;
						if (settings.buttonImg) data += '&buttonImg=' + escape(settings.buttonImg);
						if (settings.buttonText) data += '&buttonText=' + escape(settings.buttonText);
						if (settings.rollover) data += '&rollover=true';
						data += '&script=' + settings.script;
						data += '&folder=' + escape(settings.folder);
						if (settings.scriptData) {
							var scriptDataString = '';
							for (var name in settings.scriptData) {
								scriptDataString += '&' + name + '=' + settings.scriptData[name];
							}
							data += '&scriptData=' + escape(scriptDataString); 
						}
						data += '&btnWidth=' + settings.width;
						data += '&btnHeight=' + settings.height;
						data += '&wmode=' + settings.wmode;
						if (settings.fileDesc) data += '&fileDesc=' + settings.fileDesc + '&fileExt=' + settings.fileExt;
						if (settings.multi) data += '&multi=true';
						if (settings.auto) data += '&auto=true';
						if (settings.sizeLimit) data += '&sizeLimit=' + settings.sizeLimit;
						if ($.browser.msie) {
							flashElement = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + settings.width + '" height="' + settings.height + '" id="' + $(this).attr("id")  + 'Uploader" class="fileUploaderBtn">\
								<param name="movie" value="' + settings.uploader + '?fileUploadID=' + $(this).attr("id") + data + '" />\
								<param name="quality" value="high" />\
								<param name="wmode" value="' + settings.wmode + '" />\
								<param name="allowScriptAccess" value="' + settings.scriptAccess + '">\
								<param name="swfversion" value="9.0.0.0" />\
							</object>';
						} else {
							flashElement = '<embed src="' + settings.uploader + '?fileUploadID=' + $(this).attr("id") + data + '" quality="high" width="' + settings.width + '" height="' + settings.height + '" id="' + $(this).attr("id") + 'Uploader" class="fileUploaderBtn" name="' + $(this).attr("id") + 'Uploader" allowScriptAccess="' + settings.scriptAccess + '" wmode="' + settings.wmode + '" type="application/x-shockwave-flash" />';
						}
						if (settings.onInit() !== false) {
							$(this).css('display','none');
							if ($.browser.msie) {
								$(this).after('<div id="' + $(this).attr("id")  + 'Uploader"></div>');
								document.getElementById($(this).attr("id")  + 'Uploader').outerHTML = flashElement;
							} else {
								$(this).after(flashElement);
							}
							$("#" + $(this).attr('id') + "Uploader").after('<div id="' + $(this).attr('id') + 'Queue" class="fileUploadQueue"></div>');
						}
						$(this).bind("rfuSelect", {'action': settings.onSelect}, function(event, queueID, fileObj) {
							if (event.data.action(event, queueID, fileObj) !== false) {
								var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
								var suffix = 'KB';
								if (byteSize > 1000) {
									byteSize = Math.round(byteSize *.001 * 100) * .01;
									suffix = 'MB';
								}
								var sizeParts = byteSize.toString().split('.');
								if (sizeParts.length > 1) {
									byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
								} else {
									byteSize = sizeParts[0];
								}
								if (fileObj.name.length > 20) {
									fileName = fileObj.name.substr(0,20) + '...';
								} else {
									fileName = fileObj.name;
								}
								$('#' + $(this).attr('id') + 'Queue').append('<div id="' + $(this).attr('id') + queueID + '" class="fileUploadQueueItem">\
									<div class="cancel">\
										<a href="javascript:$(\'#' + $(this).attr('id') + '\').fileUploadCancel(\'' + queueID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
									</div>\
									<span class="fileName">' + fileObj.name + ' (' + byteSize + 'KB)</span>\
									<span class="percentage">&nbsp;</span>\
									<div class="fileUploadProgress" style="width: 100%;">\
										<div id="' + $(this).attr('id') + queueID + 'ProgressBar" class="fileUploadProgressBar" style="width: 1px; height: 3px;"></div>\
									</div>\
								  </div>');
							}
						});
						if (typeof(settings.onSelectOnce) == 'function') {
							$(this).bind("rfuSelectOnce", settings.onSelectOnce);
						}
						$(this).bind("rfuCancel", {'action': settings.onCancel}, function(event, queueID, fileObj, data) {
							if (event.data.action(event, queueID, fileObj, data) !== false) {
								$("#" + $(this).attr('id') + queueID).fadeOut(250, function() { $("#" + $(this).attr('id') + queueID).remove()});
							}
						});
						$(this).bind("rfuClearQueue", {'action': settings.onClearQueue}, function() {
							if (event.data.action() !== false) {
								$('#' + $(this).attr('id') + 'Queue').contents().fadeOut(250, function() {$('#' + $(this).attr('id') + 'Queue').empty()});
							}
						});
						$(this).bind("rfuError", {'action': settings.onError}, function(event, queueID, fileObj, errorObj) {
							if (event.data.action(event, queueID, fileObj, errorObj) !== false) {
								$("#" + $(this).attr('id') + queueID + " .fileName").text(errorObj.type + " Error - " + fileObj.name);
								$("#" + $(this).attr('id') + queueID).css({'border': '3px solid #FBCBBC', 'background-color': '#FDE5DD'});
							}
						});
						$(this).bind("rfuProgress", {'action': settings.onProgress}, function(event, queueID, fileObj, data) {
							if (event.data.action(event, queueID, fileObj, data) !== false) {
								$("#" + $(this).attr('id') + queueID + "ProgressBar").css('width', data.percentage + '%');
								$("#" + $(this).attr('id') + queueID + " .percentage").text(' - ' + data.percentage + '%');
							}
						});
						$(this).bind("rfuComplete", {'action': settings.onComplete}, function(event, queueID, fileObj, response, data) {
							if (event.data.action(event, queueID, fileObj, response, data) !== false) {
								$("#" + $(this).attr('id') + queueID).fadeOut(250, function() { $("#" + $(this).attr('id') + queueID).remove()});
								$("#" + $(this).attr('id') + queueID + " .uploadSpeed").text(' - Completed');
							}
						});
						if (typeof(settings.onAllComplete) == 'function') {
							$(this).bind("rfuAllComplete", settings.onAllComplete);
						}
					});
				}
			},
			fileUploadSettings:function(settingName, settingValue) {
				$(this).each(function() {
					document.getElementById($(this).attr('id') + 'Uploader').updateSettings(settingName,settingValue);
				});
			},
			fileUploadStart:function(queueID) {
				$(this).each(function() {
					document.getElementById($(this).attr('id') + 'Uploader').startFileUpload(queueID);
				});
			},
			fileUploadCancel:function(queueID) {
				$(this).each(function() {
					document.getElementById($(this).attr('id') + 'Uploader').cancelFileUpload(queueID);
				});
			},
			fileUploadClearQueue:function() {
				$(this).each(function() {
					document.getElementById($(this).attr('id') + 'Uploader').clearFileUploadQueue();
				});
			}
		})
	}
)(jQuery);

$("#next2,#prev2").css('opacity',.35);

  $(document).ready(function(){
							 

							 
$(".thecontactForm").validate({});
var filename = $(".uid").text();


$("#fileUpload").fileUpload({
	'uploader': '/lib/JS/picupload/uploader.swf',
	'buttonImg': '/lib/JS/picupload/browse.png',
	'cancelImg': '/lib/JS/picupload/cancel.png',
	'folder': '/uploads/feusers/&fname=' + filename + '_Photo',
	'script': '/lib/JS/picupload/upload.php',
	'fileExt': '*.jpg;*.jpeg;*.png;*.gif',
	'width': 110,
	'height': 30,
	'sizeLimit': '527433',
	'auto': true,
	'onComplete': function (event, queueID, fileObj, response, data) {$(".fileUploadQueueItem").fadeOut();$("div.fileUploadQueue").append('Your new photo will be<img src="uploads/feusers/' + response + '" width="25%" alt="" />');$( "input[name$='feu_hidden_Photo']" ).val("Photo;6;60;1;"+response+"");},
	'onAllComplete': function(event, queueID, fileObj, response, data) {
alert("You have completed the file upload, Submit your new settings to confirm.");},
	'onCancel': function (event, filesUploaded, filesErrored) { alert("Upload successfully stopped");}
});


$('#slideshow2').cycle({ 
    fx: 'all',
    timeout: 4000, 
    delay:  2000, 
    speed:  1000,
    next:   '#next2', 
    prev:   '#prev2',
	before: onBefore, 
    after: onAfter 
});
function onBefore() { 
    $('#ImgBox p').hide(); 
} 
function onAfter() { 
    $('#ImgBox p').css({opacity: '0.75'}).slideDown('slow'); 
} 




$("#next2,#prev2").hover(function () {$("#next2,#prev2").css('opacity',.99);},function () {$("#next2,#prev2").css('opacity',.35);});

});
 