//
//		ssscripts.js
//
//		Combines the following JavaScript files:
//
//		<!--<script language="javascript" type="text/javascript" src="/files/font_styles.js"></script>-->
//		<!--<script language="javascript" type="text/javascript" src="/files/validator.js"></script>-->
//		<!--<script language="javascript" type="text/javascript" src="/files/autosuggest.js"></script>-->
//		<!--<script language="javascript" type="text/javascript" src="/files/basket.js"></script>-->
//		<!--<script language="javascript" type="text/javascript" src="/files/currency.js"></script>-->
//		<!--<script language="javascript" type="text/javascript" src="/files/magicthumb-packed.js"></script>-->
//

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false;
		 }

 		 return true;
	}



// *** Start of font_styles.js ***

// *** TO BE CUSTOMISED ***

var style_cookie_name = "style" ;
var style_cookie_duration = 30 ;

// *** END OF CUSTOMISABLE SECTION ***

function SafelyGetXmlHttpObject(){
     var objXMLHttp = null;

     if (window.XMLHttpRequest){
         try{
             objXMLHttp = new XMLHttpRequest();
         }catch (e){
             objXMLHttp = false;
         }
     }else if (window.createRequest){
         try{
             objXMLHttp = new window.createRequest();
         }catch (e){
             objXMLHttp = false;
         }
     }else if (window.ActiveXObject){
         try {
             objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
         }catch (e){
             try {
                 objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
             }catch (e){
                 objXMLHttp = false;
             }
         }
     }

     return objXMLHttp;
}

function switch_style ( css_title )
{
// You may use this script on your site free of charge provided
// you do not remote this notice or the URL below. Script from
// http://www.thesitewizard.com/javascripts/change-style-sheets.shtml
  var i, link_tag ;
  for (i = 0, link_tag = document.getElementsByTagName("link") ;
    i < link_tag.length ; i++ ) {
    if ((link_tag[i].rel.indexOf( "stylesheet" ) != -1) &&
      link_tag[i].title) {
      link_tag[i].disabled = true ;
      if (link_tag[i].title == css_title) {
        link_tag[i].disabled = false ;
      }
    }
    set_cookie( style_cookie_name, css_title,
      style_cookie_duration );
  }
}
function set_style_from_cookie()
{
  var css_title = get_cookie( style_cookie_name );
  if (css_title.length) {
    switch_style( css_title );
  }
}
function set_cookie ( cookie_name, cookie_value,
    lifespan_in_days, valid_domain )
{
    // http://www.thesitewizard.com/javascripts/cookies.shtml
    var domain_string = valid_domain ?
                       ("; domain=" + valid_domain) : '' ;
    var strCookie = cookie_name +
                       "=" + encodeURIComponent( cookie_value ) +
                       "; max-age=" + 60 * 60 *
                       24 * lifespan_in_days +
                       "; path=/bbf" + domain_string ;
	//alert(strCookie);
	document.cookie = strCookie;
}
function get_cookie ( cookie_name )
{
    // http://www.thesitewizard.com/javascripts/cookies.shtml
    var cookie_string = document.cookie ;
    if (cookie_string.length != 0) {
        var cookie_value = cookie_string.match (
                        '(^|;)[\s]*' +
                        cookie_name +
                        '=([^;]*)' );
		if (cookie_value == null)
		{
			return '' ;
		}
        return decodeURIComponent ( cookie_value[2] ) ;
    }
    return '' ;
}

// *** End of font_styles.js ***


// *** Start of validator.js ***

var firsterrorfld='';

function ValidateAllForm(formname, sectionname) 
{
	var errorlist = '';
	var cellref = '';
	var bsection = true;
	
	firsterrorfld=null;

	var elem = document.getElementById(formname).elements;
	for(var i = 0; i < elem.length; i++)
	{
		var localInput = elem[i]
		
		if(localInput)
		{
			bsection=true;
			sectionFld=localInput.getAttribute('section')
			if (sectionFld==null)
			{
				sectionFld='';
			}
			if (sectionFld != sectionname)
			{
				bsection=false;
			}

			if (bsection)
			{

				var iValue='';

				localInput.style.borderColor=''
				localInput.style.backgroundColor=''

				var bCheckForNumeric=false;
				
				switch(localInput.tagName)
				{
					case "SELECT":
						var sel_ind = localInput.selectedIndex;
						if (sel_ind >= 0)
						{
							iValue = localInput[sel_ind].value;
						}
						break;
					case "TEXTAREA":
						iValue = localInput.value;
						bCheckForNumeric=true;
						break;
					case "INPUT":
						if(localInput.type == 'checkbox')
						{
							//iValue = (localInput.checked?'on':'off');
							iValue = (localInput.checked?localInput.value:'');
						}
						else
						{
							iValue = localInput.value;
							bCheckForNumeric=true;
						}
						break;
				}
				
				var bNumericCheckPassed=true;
				if (bCheckForNumeric)
				{
					var numericFld=localInput.getAttribute('numeric')
					if (numericFld)
					{
						iValue=cleanCommas(iValue);
						localInput.value=iValue;
						if (!IsItNumeric(iValue))
						{
							bNumericCheckPassed=false;
						}
					}
				}
				
				var bDateCheckPassed=true;
				if (bCheckForNumeric)
				{
					var dtFld=localInput.getAttribute('checkdate')
					if (dtFld)
					{
						if (!isDate(iValue))
						{
							bDateCheckPassed=false;
						}
					}
				}
				
				var bEmailCheckPassed=true;
				var dtFld=localInput.getAttribute('checkemail')
				if (dtFld)
				{
					if (!echeck(iValue))
					{
						bEmailCheckPassed=false;
					}
				}
			
				parentdiv=localInput.getAttribute('parentdiv')
				parentdiv2=localInput.getAttribute('parentdiv2')
				parentdiv3=localInput.getAttribute('parentdiv3')

				// Checks if the required attribute is present - if so, then checks this element has a value
				requiredFld=localInput.getAttribute('required')
				if (requiredFld)
				{
					var elemDisplay=localInput;
					var elemDisplay2=localInput;
					var elemDisplay3=localInput;
					if (parentdiv)
					{
						elemDisplay=document.getElementById(parentdiv);
						elemDisplay2=document.getElementById(parentdiv);
						elemDisplay3=document.getElementById(parentdiv);
					}
					if (parentdiv2)
					{
						elemDisplay2=document.getElementById(parentdiv2);
						elemDisplay3=document.getElementById(parentdiv2);
					}
					if (parentdiv3)
					{
						elemDisplay3=document.getElementById(parentdiv3);
					}

					if ((elemDisplay.style != null) && (elemDisplay2.style != null) && (elemDisplay3.style != null))
					{
						if ((elemDisplay.style.display != 'none') && (elemDisplay2.style.display != 'none') && (elemDisplay3.style.display != 'none'))
						{

							var notzero=localInput.getAttribute('notzero')
							if (notzero == 'true')
							{
								if ((iValue == '0') || (iValue == '0.00') || (iValue == '0.0') || (iValue == '00') || (iValue == '000'))
								{
									iValue='';
								}
							}					

							if ((!bEmailCheckPassed) || (!bDateCheckPassed) || (!bNumericCheckPassed) || ((requiredFld != '') && (iValue == '')))
							{
								errorlist += '- ' + localInput.getAttribute('descr') + '<br>';
								localInput.style.borderColor='red'
								localInput.style.backgroundColor='#f8e6e7'

								if (firsterrorfld == null)
								{
									firsterrorfld = localInput;
								}
							}
						}
					}
				}

				// Checks if the requiredif attribute is present - if so, then it makes this element required if the other has a value
				requiredFldIf=localInput.getAttribute('requiredif')
				if ((requiredFldIf) && (requiredFld != '') && (iValue == ''))
				{
					var elemDisplay=localInput;
					var elemDisplay2=localInput;
					if (parentdiv)
					{
						elemDisplay=document.getElementById(parentdiv);
						elemDisplay2=document.getElementById(parentdiv);
					}
					if (parentdiv2)
					{
						elemDisplay2=document.getElementById(parentdiv2);
					}

					if ((elemDisplay.style.display != 'none') && (elemDisplay2.style.display != 'none'))
					{
						iValue='';
						var requiredFldElement = document.getElementById(requiredFldIf)
						switch(requiredFldElement.tagName)
						{
							case "SELECT":
								var sel_ind = requiredFldElement.selectedIndex;
								if (sel_ind >= 0)
								{
									iValue = requiredFldElement[sel_ind].value;
								}
								break;
							case "TEXTAREA":
								iValue = requiredFldElement.value;
								break;
							case "INPUT":
								if(requiredFldElement.type == 'checkbox')
								{
									//iValue = (requiredFldElement.checked?'on':'off');
									iValue = (requiredFldElement.checked?localInput.value:'');
								}
								else
								{
									iValue = requiredFldElement.value;
								}
								break;
						}
						
						var notzero=localInput.getAttribute('notzero')
						if (notzero == 'true')
						{
							if ((iValue == '0') || (iValue == '0.00') || (iValue == '0.0') || (iValue == '00') || (iValue == '000'))
							{
								iValue='';
							}
						}

						//var reqvalue=localInput.getAttribute('requiredvalue')
						//if (reqvalue == null)
						//{
						//	reqvalue=''
						//}

						if ((!bEmailCheckPassed) || (!bDateCheckPassed) || (!bNumericCheckPassed) || ((requiredFld != '') && (iValue == '')))
						{
							errorlist += '- ' + localInput.getAttribute('descr') + '<br>';
							localInput.style.borderColor='red'
							localInput.style.backgroundColor='#f8e6e7'
							
							if (firsterrorfld == null)
							{
								firsterrorfld = localInput;
							}
						}
					}
				}
			}
		}
		else
		{
			break;
		}
	}
	return errorlist;
}

// *** End of validator.js ***


// *** Start of autosuggest.js ***

var req = null;
var timr = null;
var suggtmr = null;

function submitSearch(searchBox) {
    keyValue = document.getElementById(searchBox).value;
    if (keyValue != "") {
        document.location.href = "/search.aspx?q=" + escape(keyValue);
    }
}

function GetSearchSuggestions(pressevent) {
    keyValue = document.getElementById("search_box").value;


    if (keyValue != "") {
        //alert(keyValue)


        var charCode = (pressevent.which) ? pressevent.which : (event.keyCode);

        // alert(charCode);

        // Send to the Server Side Method to get the string

        if (charCode >= 65 && charCode <= 90 || charCode >= 97 && charCode <= 122) {
            if (timr != null) {
                clearTimeout(timr);
            }
            timr = setTimeout("GetSearchResults()", 500);
        }

        // if the backspace key (8) is pressed and 48 is for the delete button

        else if (charCode == 8 || charCode == 48) {

            // Reset the count

            _highlightSuggestionIndex = -2;

            if (timr != null) {
                clearTimeout(timr);
            }
            timr = setTimeout("GetSearchResults()", 500);

        }

        // when the down arrow key is pressed

        else if (charCode == 40) {

            if ((_highlightSuggestionIndex + 2) <= document.getElementById("SearchSuggestionsDisplay").childNodes.length) {

                _highlightSuggestionIndex = _highlightSuggestionIndex + 2;

            }

            Highlight(_highlightSuggestionIndex);

        }

        // When the up arrow key is pressed

        else if (charCode == 38) {
            if ((_highlightSuggestionIndex - 2) >= 0) {

                _highlightSuggestionIndex = _highlightSuggestionIndex - 2;

            }

            Highlight(_highlightSuggestionIndex);
        }
    }
    else {
        //document.getElementById("SearchResultsContainer").style.visibility = "invisible";
        document.getElementById("SearchResultsContainer").style.display = "none";
    }
}

function KeepSearchSuggestions() {
    if (suggtmr != null) {
        clearTimeout(suggtmr);
        suggtmr = null;
    }
}

function HideSearchSuggestions() {
    suggtmr = setTimeout("HideSearchSuggestionsNow()", 3000);
}

function HideSearchSuggestionsNow() {
    if (suggtmr != null) {
        document.getElementById("SearchResultsContainer").style.display = "none";
    }
}

function GetSearchResults() {
    keyValue = document.getElementById("search_box").value;
    AjaxGetSearchData('/SiteSphereHandler.ashx?search=' + escape(keyValue), resultHandler);
}

function resultHandler() {
    try {
        //readyState of 4 or 'complete' represents  
        //that data has been returned  
        if (req.readyState == 4 ||
            req.readyState == 'complete') {
            word = req.responseText;
            //document.location.href = document.location.href;
            //alert(req.responseText);

            //document.getElementById("SearchResultsContainer").style.visibility = "visible";
            document.getElementById("SearchResultsContainer").style.display = "block";

            document.getElementById("SearchSuggestionsDisplay").innerHTML = "<div><ul>" + word.substring(0, word.length - 5) + "</ul></div>";

        }
    }
    catch (e) {
        alert('Error in Ajax respone');
    }
}

function AjaxGetSearchData(url, responseHandler) {
    if (window.XMLHttpRequest) {
        // browser has native support for XMLHttpRequest object 
        req = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        // try XMLHTTP ActiveX (Internet Explorer) version 
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }

    if (req) {
        req.onreadystatechange = responseHandler;
        req.open('GET', url, true);
        req.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        req.send('');
    }
    else {
        alert('Your browser does not seem to support XMLHttpRequest.');
    }
}

function GetXmlHttpObject() {
    var xmlHttp = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        //Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}

// *** End of autosuggest.js ***


// *** Start of basket.js ***

function AddToShortcuts(vuid, id, caption, notes)
{
    AjaxGetSSData('/SiteSphereHandler.ashx?action=profileadditemshortcut&visitoruid=' + vuid + '&itemid=' + id + '&url=' + escape(document.location.href) + '&caption=' + escape(caption) + '&notes=' + escape(notes), SSAjaxResultHandler);
}

function AddToShortcutsWithPage(vuid, id, caption, notes, pageurl)
{
    AjaxGetSSData('/SiteSphereHandler.ashx?action=profileadditemshortcut&visitoruid=' + vuid + '&itemid=' + id + '&url=' + escape(pageurl) + '&caption=' + escape(caption) + '&notes=' + escape(notes), SSAjaxResultHandler);
}

function DeleteFromShortcuts(vuid, id)
{
    AjaxGetSSData('/SiteSphereHandler.ashx?action=profiledeleteshortcut&visitoruid=' + vuid + '&shortcutid=' + id, SSAjaxResultHandler);
}

function UpdateShortcut(vuid, id, caption, notes)
{
    AjaxGetSSData('/SiteSphereHandler.ashx?action=profileupdateshortcut&visitoruid=' + vuid + '&shortcutid=' + id + '&caption=' + escape(caption) + '&notes=' + escape(notes), SSAjaxResultHandler);
}

function BasketRemoveItem(id, buid) {
    AjaxGetSSData('/SiteSphereHandler.ashx?action=basketremoveitem&basketuid=' + buid + '&lineid=' + id, SSShowBasketResultHandler);
}

function RefreshPage() {
    document.location.href = document.location.href;
}

function checkout() {

    document.location.href = "/checkout/";
}

function SSAjaxResultHandler() {
    try {
        //readyState of 4 or 'complete' represents  
        //that data has been returned  
        if (ajaxreq.readyState == 4 ||
            ajaxreq.readyState == 'complete') {
            //alert( ajaxreq.responseText );
            document.location.href = document.location.href;
            //location.reload(true);
        }
    }
    catch (e) {
        alert('Error in Ajax respone');
    }
}


function SSShowBasketResultHandler() {
    try {
        //readyState of 4 or 'complete' represents  
        //that data has been returned  
        if (ajaxreq.readyState == 4 ||
            ajaxreq.readyState == 'complete') {
            //alert( ajaxreq.responseText );
            document.location.href = "/cart/";
            //location.reload(true);
        }
    }
    catch (e) {
        alert('Error in Ajax respone');
    }
}


function AjaxGetSSData(url, responseHandler) {
    if (window.XMLHttpRequest) {
        // browser has native support for XMLHttpRequest object
        ajaxreq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        // try XMLHTTP ActiveX (Internet Explorer) version
        ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
    }

    if (ajaxreq) {
        ajaxreq.onreadystatechange = responseHandler;
        ajaxreq.open('GET', url, true);
        ajaxreq.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        ajaxreq.send('');
    }
    else {
        alert('Your browser does not seem to support XMLHttpRequest.');
    }
}

function AjaxPostSSData(url, datafieldname, datatopost) {

	var reqThis = SafelyGetXmlHttpObject();

    if (reqThis) {
        reqThis.open('POST', url, false);
        reqThis.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        reqThis.send(datafieldname+"="+datatopost);

	    try {
		//readyState of 4 or 'complete' represents  
		//that data has been returned  
		if (reqThis.readyState == 4 ||
		    reqThis.readyState == 'complete') {
		}
		var sRet = reqThis.responseText;
		//alert(sRet);
	    	return sRet;
	    }
	    catch (e) {
		var s='Error in response to: ' + url;
		return s;
	    }
    }
    else {
        var s='Your browser does not seem to support XMLHttpRequest.';
	return s;
    }
}


function CallServerNow(url) {

	var reqThis = SafelyGetXmlHttpObject();

    if (reqThis) {
        reqThis.open('GET', url, false);
        reqThis.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        reqThis.send('');

	    try {
		//readyState of 4 or 'complete' represents  
		//that data has been returned  
		if (reqThis.readyState == 4 ||
		    reqThis.readyState == 'complete') {
		}
		var sRet = reqThis.responseText;
		//alert(sRet);
	    	return sRet;
	    }
	    catch (e) {
		var s='Error in response to: ' + url;
		return s;
	    }
    }
    else {
        var s='Your browser does not seem to support XMLHttpRequest.';
	return s;
    }
}


// *** End of basket.js ***


// *** Start of currency.js ***

// disclaimerclosed variable used to determine if mouse is on tooltip or not (1=not, 0=on)
var disclaimerclosed = 1;

function dropcurrencylist() {
	//drop down currency list]
	var curlist = document.getElementById('currencyselect');
	if(curlist.style.display=='block'){
		curlist.style.display='none';
	}
	else{
		document.getElementById('curdisclaimer').style.display = "none";
		curlist.style.display='block';
	}
}

function Set_Cookie(name, value, expires, path, domain, secure) {
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime(today.getTime());

    /*
    if the expires variable is set, make the correct
    expires time, the current script below will set
    it for x number of days, to make it for hours,
    delete * 24, for minutes, delete * 60 * 24
    */
    if (expires) {
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

// this fixes an issue with the old method, ambiguous values
// with this test document.cookie.indexOf( name + "=" );
function Get_Cookie(check_name) {
    // first we'll split this cookie up into name/value pairs
    // note: document.cookie only returns name=value, not the other components
    var a_all_cookies = document.cookie.split(';');
    var a_temp_cookie = '';
    var cookie_name = '';
    var cookie_value = '';
    var b_cookie_found = false; // set boolean t/f default f

    for (i = 0; i < a_all_cookies.length; i++) {
        // now we'll split apart each name=value pair
        a_temp_cookie = a_all_cookies[i].split('=');


        // and trim left/right whitespace while we're at it
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

        // if the extracted name matches passed check_name
        if (cookie_name == check_name) {
            b_cookie_found = true;
            // we need to handle case where cookie has no value but exists (no = sign, that is):
            if (a_temp_cookie.length > 1) {
                cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
            }
            // note that in cases where cookie is initialized but no value, null is returned
            return cookie_value;
            break;
        }
        a_temp_cookie = null;
        cookie_name = '';
    }
    if (!b_cookie_found) {
        return null;
    }
}

function displaycurrency(thecurrency)
{
  //set value into currency combo box and show disclaimer
    var curbox = document.getElementById('currencybox');

    switch (thecurrency.toLowerCase()) {
        case 'eur':
            Set_Cookie('SSCURRENCYJABSCOSHOP', "EUR", "90", "/");
            break;
        case 'gbp':
            Set_Cookie('SSCURRENCYJABSCOSHOP', "GBP", "90", "/");
            break;
        case 'usd':
            Set_Cookie('SSCURRENCYJABSCOSHOP', "USD", "90", "/");
            break;
        default:
            Set_Cookie('SSCURRENCYJABSCOSHOP', "GBP", "90", "/");
    }


    if (curbox != null) {
    
        
    
        switch (thecurrency.toLowerCase()) {
            case 'eur':
                curbox.innerHTML = "<table cellpadding='0' cellspacing='0' border='0'><tr><td width='17' style='width:17px'><img src='/images/flags/16x16/plain/flag_eu.png' id='flagtype' width='16' height='16' align='left' /></td><td>Euro - EUR</td></tr></table>";
                break;
            case 'gbp':
                curbox.innerHTML = "<table cellpadding='0' cellspacing='0' border='0'><tr><td width='17' style='width:17px'><img src='/images/flags/16x16/plain/flag_united_kingdom.png' id='flagtype' width='16' height='16' align='left' /></td><td>British Pound - GBP</td></tr></table>";
                break;
            case 'usd':
                curbox.innerHTML = "<table cellpadding='0' cellspacing='0' border='0'><tr><td width='17' style='width:17px'><img src='/images/flags/16x16/plain/flag_usa.png' id='flagtype' width='16' height='16' align='left' /></td><td>US Dollar - USD</td></tr></table>";
                break;
            default:
                curbox.innerHTML = "<table cellpadding='0' cellspacing='0' border='0'><tr><td width='17' style='width:17px'><img src='/images/flags/16x16/plain/flag_united_kingdom.png' id='flagtype' width='16' height='16' align='left' /></td><td>British Pound - GBP</td></tr></table>";
        }
    }

    if (document.getElementById('currencyselect') != null) {
        document.getElementById('currencyselect').style.display = "none";
    }
}

if (Get_Cookie("SSCURRENCYJABSCOSHOP") == "") {
    Set_Cookie("SSCURRENCYJABSCOSHOP", "GBP", "90", "/");
}

function setcurrency(thecurrency) {
    displaycurrency(thecurrency);

    /*if (thecurrency != 'gbp') 
    {
        // If currency code is set to the session bean correctly, a response object will be returned. The current page should be refreshed.
        disclaimerclosed = 0;
        document.getElementById("curdisclaimer").style.display ="block";
        setTimeout ('closedisclaimer()', 4000);
    }*/
    SetBasketCurrency(thecurrency);
    //location.reload(true);
}

function closedisclaimer() {
	//loop timer until mouse is off disclaimer, if mouse is off (disclaimerclosed = 1) then okay to close it, otherwise continue loop
	if (document.getElementById('curdisclaimer').style.display == "none") {
		//if its already closed
		return;
	}
	else {
		if (disclaimerclosed == 1) {
		    document.getElementById("curdisclaimer").style.display ="none";
			location.reload(true);
			return;
		}
		setTimeout ('closedisclaimer()', 1000);
	}
}

function closenow()
{
    document.getElementById("curdisclaimer").style.display = "none";
	location.reload(true);
}

// *** End of currency.js ***


// *** Start of magicthumb-packed.js ***

/* Copyright 2008 MagicToolBox.com. To use this code on your own site, visit http://www.magictoolbox.com */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('b 7={2X:\'1.2V\',z:{H:!!(h.1G&&!h.1r),2Z:!!(h.1G&&!h.2x),31:!!(h.32&&h.2x),1r:!!h.1r,2T:17.1i.P(\'3n/\')>-1,3h:17.1i.P(\'3g\')>-1&&17.1i.P(\'3f\')==-1,3i:!!17.1i.3j(/33.*3m.*3l/),1B:f.2u&&\'3k\'==f.2u.3e()},$:6(4){a(!4)8 15;a("3d"==1p 4){4=f.36(4)}8 4},$A:6(C){a(!C)8[];a(C.2r){8 C.2r()}b B=C.B||0,1H=1L 1z(B);2R(B--)1H[B]=C[B];8 1H},1l:6(U,1X){a(\'26\'===1p(U)){8 U}I(b p 1I 1X){U[p]=1X[p]}8 U},1D:6(){b 1C=[];I(b i=0,2S=K.B;i<2S;i++){I(b j=0,2O=K[i].B;j<2O;j++){1C.34(K[i][j])}}8 1C},2p:6(){b F=7.$A(K),1a=F.16(),19=F.16();8 6(){8 1a.1J(19,7.1D(F,7.$A(K)))}},38:6(){b F=7.$A(K),1a=F.16(),19=F.16();8 6(c){8 1a.1J(19,7.1D([c||h.c],F))}},39:6(m,C){b 14=C.B;I(b i=0;i<14;i++){a(m===C[i]){8 1k}}8 Q},L:6(){8 1L 3b().3a()},3c:6(){b Z,13,X,W,1c,1o;b G=(!7.z.1B)?f.M:f.q;b q=f.q;Z=(h.1u&&h.23)?h.1u+h.23:(q.1f>q.1w)?q.1f:(7.z.H&&7.z.1B)?q.1f:q.1w;13=(h.S&&h.2k)?h.S+h.2k:(q.2j>q.1A)?q.2j:q.1A;b 1b,1g;1b=7.z.H?G.1f:(f.M.1N||E.1u),1g=7.z.H?G.1m:(f.M.1m||E.S);1c=(E.28)?E.28:G.35;1o=(E.2d)?E.2d:G.37;a(13<1g){X=1g}w{X=13}a(Z<1b){W=1b}w{W=Z}8{W:W,X:X,1x:7.z.H?G.1N:(f.M.1N||E.1u),1y:7.z.H?G.1m:(7.z.1r)?E.S:(E.S||f.M.1m),1c:1c,1o:1o,30:Z,2U:13}},2Y:{2W:6(4,c,N){4=7.$(4);a(4.1Y){4.1Y(c,N,Q)}w{4.1G("1M"+c,N)}},3w:6(4,c,N){4=7.$(4);a(4.22){4.22(c,N,Q)}w{4.42("1M"+c,N)}},41:6(c){a(c.2g){c.2g()}w{c.43=1k}a(c.2h){c.2h()}w{c.44=Q}},46:6(4,1W,1R){4=7.$(4);a(4==f&&f.1n&&!4.21)4=f.M;b c;a(f.1n){c=f.1n(1W);c.45(1R,1k,1k)}w{c=f.40();c.3Z=1W}a(f.1n){4.21(c)}w{4.3U(\'1M\'+1R,c)}8 c}},T:{2i:6(s){8 s.1K(/^\\s+|\\s+$/g,\'\')},1q:6(s){8 s.1K(/-(\\D)/g,6(48,25){8 25.3T()})}},O:{2f:6(4,J){a(!(4=7.$(4))){8}8((\' \'+4.V+\' \').P(\' \'+J+\' \')>-1)},3V:6(4,J){a(!(4=7.$(4))){8}a(!7.O.2f(4,J)){4.V+=(4.V?\' \':\'\')+J}},3W:6(4,J){a(!(4=7.$(4))){8}4.V=7.T.2i(4.V.1K(1L 3Y(\'(^|\\\\s)\'+J+\'(?:\\\\s|$)\'),\'$1\'))},3X:6(4,v){4=7.$(4);v=v==\'24\'?\'1Z\':7.T.1q(v);b m=4.v[v];a(!m&&f.2e){b 1V=f.2e.47(4,15);m=1V?1V[v]:15}w a(!m&&4.1s){m=4.1s[v]}a(\'k\'==v)8 m?1E(m):1.0;a(/^(4f(29|2a|2b|2c)4h)|((4g|4a)(29|2a|2b|2c))$/.49(v)){m=4b(m)?m:\'4c\'}8 m==\'4e\'?15:m},2s:6(4,o){6 2J(s,n){a(\'4d\'===1p(n)&&!(\'3o\'===s||\'2L\'===s)){8\'3R\'}8\'\'}4=7.$(4);b r=4.v;I(b s 1I o){3y{a(\'k\'===s){7.O.2E(4,o[s]);2v}a(\'24\'===s){r[(\'26\'===1p(r.27))?\'1Z\':\'27\']=o[s];2v}r[7.T.1q(s)]=o[s]+2J(7.T.1q(s),o[s])}3x(e){}}8 4},2E:6(4,k){4=7.$(4);b r=4.v;k=1E(k);a(k==0){a(\'2F\'!=r.1j)r.1j=\'2F\'}w{a(k>1){k=1E(k/18)}a(\'2G\'!=r.1j)r.1j=\'2G\'}a(!4.1s||!4.1s.3z){r.2L=1}a(7.z.H){r.3A=(k==1)?\'\':\'3B(k=\'+k*18+\')\'}r.k=k;8 4},2N:6(4){4=7.$(4);8{\'1x\':4.1w,\'1y\':4.1A}},2l:6(4){4=7.$(4);b l=t=0;3S{l+=4.3v||0;t+=4.3q||0;4=4.3p}2R(4);8{\'1e\':t,\'1d\':l}},3r:6(4){b p=7.O.2l(4);b s=7.O.2N(4);8{\'1e\':p.1e,\'3s\':p.1e+s.1y,\'1d\':p.1d,\'3u\':p.1d+s.1x}}},Y:{3t:6(x){8 x},2P:6(x){8-(u.2t(u.2B*x)-1)/2},2D:6(p){8 u.1h(p,2)},3C:6(p){8 1-7.Y.2D(1-p)},2C:6(p){8 u.1h(p,3)},3D:6(p){8 1-7.Y.2C(1-p)},2m:6(p,x){x=x||1.3N;8 u.1h(p,2)*((x+1)*p-x)},3M:6(p,x){8 1-7.Y.2m(1-p)},3O:6(p,x){x=x||[];8 u.1h(2,10*--p)*u.2t(20*p*u.2B*(x[0]||1)/3)},3P:6(x){8 0}}};7.2w=6(){9.2y.1J(9,K)};7.2w.1F={2A:{2K:3Q,3L:0.5,2z:7.Y.2P,2H:6(){},1U:6(){},2q:6(){}},y:{},2y:6(4,2n){9.4=4;9.y=7.1l(7.1l({},9.2A),2n);9.R=Q},1T:6(1t,d){8(1t[1]-1t[0])*d+1t[0]},3K:6(o){9.o=o;9.3F=0;9.3E=0;9.1P=7.L();9.2Q=9.1P+9.y.2o*1O;9.R=3G(7.2p(9.2M,9),u.1S(1O/9.y.2K));9.y.2H()},2M:6(){b L=7.L();a(L>=9.2Q){a(9.R){3H(9.R);9.R=Q}9.1Q(1.0);3J(9.y.1U,10);9.y.1U=6(){};8 9}b 12=9.y.2z((L-9.1P)/(9.y.2o*1O));9.1Q(12)},1Q:6(12){b 11={};I(b s 1I 9.o){a(\'k\'===s){11[s]=u.1S(9.1T(9.o[s],12)*18)/18}w{11[s]=u.1S(9.1T(9.o[s],12))}}9.y.2q(11);7.O.2s(9.4,11)}};a(!1z.1F.P){7.1l(1z.1F,{\'P\':6(2I,1v){b 14=9.B;I(b i=(1v<0)?u.3I(0,14+1v):1v||0;i<14;i++){a(9[i]===2I)8 i}8-1}})}',62,266,'||||el||function|MagicTools|return|this|if|var|event|||document||window|||opacity||val||styles||body|elStyle|||Math|style|else||options|browser||length|arr||self|args|ieBody|ie|for|klass|arguments|now|documentElement|handler|Element|indexOf|false|timer|innerHeight|String|obj|className|pageWidth|pageHeight|Transition|xScroll||to_css|dx|yScroll|len|null|shift|navigator|100|object|__method|windowWidth|scrollX|left|top|scrollWidth|windowHeight|pow|userAgent|visibility|true|extend|clientHeight|createEvent|scrollY|typeof|camelize|opera|currentStyle|ft|innerWidth|from|offsetWidth|width|height|Array|offsetHeight|backCompatMode|result|concat|parseFloat|prototype|attachEvent|results|in|apply|replace|new|on|clientWidth|1000|startTime|render|evName|round|calc|onComplete|css|evType|props|addEventListener|cssFloat||dispatchEvent|removeEventListener|scrollMaxX|float|m2|undefined|styleFloat|pageXOffset|Top|Bottom|Left|Right|pageYOffset|defaultView|hasClass|stopPropagation|preventDefault|trim|scrollHeight|scrollMaxY|getPosition|backIn|opt|duration|bind|onBeforeRender|toArray|setStyle|cos|compatMode|continue|Render|XMLHttpRequest|init|transition|defaults|PI|cubicIn|quadIn|setOpacity|hidden|visible|onStart|item|addpx|fps|zoom|loop|getSize|arrlen|sin|finishTime|while|arglen|webkit|viewHeight|09|add|version|Event|ie6|viewWidth|ie7|ActiveXObject|Apple|push|scrollLeft|getElementById|scrollTop|bindAsEvent|inArray|getTime|Date|getPageSize|string|toLowerCase|KHTML|Gecko|gecko|mobilesafari|match|backcompat|Safari|Mobile|AppleWebKit|zIndex|offsetParent|offsetTop|getRect|bottom|linear|right|offsetLeft|remove|catch|try|hasLayout|filter|alpha|quadOut|cubicOut|curFrame|state|setInterval|clearInterval|max|setTimeout|start|duraton|backOut|618|elastic|none|50|px|do|toUpperCase|fireEvent|addClass|removeClass|getStyle|RegExp|eventType|createEventObject|stop|detachEvent|cancelBubble|returnValue|initEvent|fire|getComputedStyle|m1|test|margin|parseInt|0px|number|auto|border|padding|Width'.split('|'),0,{}))

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('g 9={4Z:\'1.2.4Y\',P:[],1c:[],S:4E,Q:C,4A:{13:7.1O.4X,S:4E,1e:0.5,3J:C,1S:C,1R:\'3z\',20:\'1Y\',2D:0.5,2E:0,44:\'#4W\',3k:0.2,4Q:O,3i:C,1Z:0.4V,2z:\'2O\',3q:O,1V:\'A 1f\',3m:[\'2W\',\'J\',\'2U\']},j:{},4b:{\'2W\':{B:0,1I:\'4U\'},\'J\':{B:1,1I:\'5d\'},\'2U\':{B:2,1I:\'59\'}},2v:m(){6.j=7.21(6.4A,6.j);6.j.1R=/3E/i.1X(6.j.1R)?\'3E\':\'3z\';6.j.20=/1u/i.1X(6.j.20)?\'1u\':\'1Y\';6.S=6.j.S;g 31=u.2M("a");g l=31.1y;g 4J=0;2B(g i=0;i<l;i++){b(7.8.52(31[i],\'9\')){9.P.3h(1w 9.2T(31[i],4J++,{4o:(6.j.53||6.j.1e),4v:(6.j.54||6.j.1e),1Z:6.j.1Z,2z:6.j.2z,13:6.j.13,1S:6.j.1S,20:6.j.20,2D:6.j.2D,1R:6.j.1R}))}}},55:m(){2B(g t=9.P.2L();t!=Z&&16!=t;t=9.P.2L()){t.3U();3l t};9.P=[];9.1c=[];9.2v();D},25:m(e,1d){b(e){7.E.1J(e)}g t=9.1H();b(!9.j.3J&&16!=t&&1d!=t.B){9.1H().1M(Z,9.P[1d],O)}1A{9.P[1d].25(6.S)}},4R:m(1d){g T=6.1c.4x(1d);b(-1!==T){6.1c.4I(T,1)}6.1c.3h(1d)},1H:m(){D(6.1c.1y>0)?6.P[6.1c[6.1c.1y-1]]:16},4N:m(1d){g T=6.1c.4x(1d);b(-1===T){D}6.1c.4I(T,1)},3L:m(1o){1o=1o||C;g J=9.P[9.1H().B+1];b(16==J&&1o){J=9.P[0]}D J},3M:m(1o){1o=1o||C;g J=9.P[9.1H().B-1];b(16==J&&1o){J=9.P[9.P.1y-1]}D J},4h:m(){D 9.P[0]},4i:m(){D 9.P[9.P.1y-1]},2N:m(e){b(!9.j.4Q){7.E.2j(u,\'3R\',9.2N);D O}g 4M=e.56,w=Z,r=C;3V(4M){1a 27:w=0;1s;1a 32:w=1;r=O;1s;1a 34:w=1;1s;1a 33:w=-1;1s;1a 39:1a 40:b((9.j.3i)?(e.4P||e.3Z):O){w=1}1s;1a 37:1a 38:b((9.j.3i)?(e.4P||e.3Z):O){w=-1}1s}b(Z!==w){b(9.1c.1y>0){7.E.1J(e)}3X{g 3f=9.1H();g J=Z;b(0==w){3f.1M(Z)}1A b(-1==w){J=9.3M(r)}1A b(1==w){J=9.3L(r)}b(16!=J){3f.1M(Z,J)}}4O(e){b(3Y){3Y.5a(e.5b)}}}},36:m(2m){b(7.1r.5c){7.8.k(2m,{\'4f\':\'4g\'})}},4z:m(){b(9.Q&&\'1D\'!=7.8.L(9.Q,\'H\')){D}b(!9.Q){9.Q=u.W(\'1Q\');7.8.1v(9.Q,\'9-57\');g x=7.2H();7.8.k(9.Q,{\'F\':\'V\',\'H\':\'11\',\'A\':0,\'q\':0,\'n\':x.46,\'v\':x.45,\'2b-3s\':9.j.44,\'1g\':0});g 3g=u.W(\'2q\');7.8.k(3g,{\'n\':\'23%\',\'v\':\'23%\',\'H\':\'11\',\'3P\':\'4C()\',\'A\':0,\'4D\':0,\'F\':\'V\',\'z-B\':-1,\'19\':\'1D\'});9.Q.X(3g);u.1L.X(9.Q);7.E.2c(4w,\'51\',m(){g x=7.2H();7.8.k(9.Q,{\'n\':x.n,\'v\':x.v});2X(m(){g x=7.2H();7.8.k(9.Q,{\'n\':x.46,\'v\':x.45})},1)})}1w 7.1C(9.Q,{1e:9.j.3k,13:7.1O.2Y,2y:m(){7.8.k(9.Q,{\'H\':\'11\',\'1g\':0})}}).1E({\'1g\':[0,9.j.2E]})},4K:m(){1w 7.1C(9.Q,{1e:9.j.3k,13:7.1O.2Y,2x:m(){7.8.k(9.Q,{\'H\':\'1D\'})}}).1E({\'1g\':[9.j.2E,0]})}};9.2T=m(){6.2v.58(6,4e)};9.2T.4a={2v:m(a,1d,48){6.j={};6.U=a;6.B=1d;6.1b=C;6.2i=C;6.y=C;6.p=C;6.G=C;6.d=C;6.2p=[];6.3K=O;6.j=7.21(6.j,48);6.3x=7.17(6.47,6);6.d=u.W(\'1q\');7.E.2c(6.d,\'2r\',6.3x);2X(7.17(m(){6.d.2A=a.4d},6),1)},3U:m(){2B(g c=6.2p.2L();c!=Z&&16!=c;c=6.2p.2L()){7.E.2j(c.4l,c.49,c.2o);3l c}3l 6.2p;b(!6.1b){u.1L.3T(6.d)}1A{7.8.3N(6.U,\'9-1b\');7.8.k(6.K,{\'R\':\'1h\'});9.36(6.U)}u.1L.3T(6.y)},1k:m(2m,3n,2o){7.E.2c(2m,3n,2o);6.2p.3h({\'4l\':2m,\'49\':3n,\'2o\':2o})},4u:m(){6.G=u.W("1Q");7.8.k(6.G,{\'F\':\'V\',\'q\':-1K,\'R\':\'M\',\'z-B\':3});7.8.1v(6.G,\'9-G\');6.y.X(6.G);g 50=[];g 2d=6.j.3m||9.j.3m;g 4p=2d.1y;2B(g i=0;i<4p;i++){b(\'J\'==2d[i]&&9.4i()===6){4c}b(\'2W\'==2d[i]&&9.4h()===6){4c}g 3j=9.4b[2d[i]];g I=u.W(\'a\');I.1I=3j.1I;I.4d=\'#\';I.3I=2d[i];7.8.k(I,{\'5x\':\'q\',\'F\':\'3F\'});I=6.G.X(I);g w=-3j.B*N(7.8.L(I,\'n\'));g h=N(7.8.L(I,\'v\'));g 1j=u.W(\'2O\');7.8.k(1j,{\'q\':w,\'4f\':\'4g\'});I.X(1j);g 2P=u.W(\'1q\');7.E.2c(2P,\'2r\',7.17(m(1q){7.E.2j(1q,\'2r\',4e.5J);7.8.k(6,{\'n\':1q.n,\'v\':1q.v})},1j,2P));2P.2A=7.8.L(1j,\'2b-1W\').3C(/3A\\s*\\(\\s*\\"{0,1}([^\\"]*)\\"{0,1}\\s*\\)/i,\'$1\');b(7.1r.2k){g 2S=7.8.L(1j,\'2b-1W\');2S=2S.3C(/3A\\s*\\(\\s*"(.*)"\\s*\\)/i,\'$1\');1j.3y.H=\'3t-11\';7.8.k(1j,{\'z-B\':1,\'F\':\'3F\'});1j.3y.3P="5R:5F.5G.5H(2A=\'"+2S+"\', 5e=\'5E\')";1j.3y.5A=\'1D\'}6.1k(I,\'1u\',7.1t(m(e,w,h){7.8.k(6.2n,{\'q\':w,\'A\':h})},I,w,-h));6.1k(I,\'3r\',7.1t(m(e,w,h){7.8.k(6.2n,{\'q\':w,\'A\':0})},I,w));6.1k(I,\'1Y\',7.1t(6.41,6));b(\'2U\'==I.3I&&/q/i.1X(6.j.1V||9.j.1V)&&6.G.2n!==I){I=6.G.4B(I,6.G.2n)}}b(7.1r.2k){6.22=u.W(\'1Q\');7.8.k(6.22,{\'F\':\'V\',\'q\':-1K,\'z-B\':4,\'n\':18,\'v\':18,\'2b-1W\':\'3A(\'+6.d.2A+\')\',\'R\':\'1h\',\'H\':\'11\',\'2b-1o\':\'5P-1o\'});6.y.X(6.22)}},47:m(){m 4L(3o){g 3D="";2B(i=0;i<3o.1y;i++){3D+=5N.5M(14^3o.5n(i))}D 3D}m 2K(2I){g 43=/\\[a\\s+(.+)\\](.+)\\[\\/a\\]/5f;D 2I.3C(43,"<a $1>$2</a>")}7.E.2j(6.d,\'2r\',6.3x);6.y=u.W("1Q");7.8.k(6.y,{\'F\':\'V\',\'H\':\'11\',\'R\':\'M\'});7.8.1v(6.y,\'9-5i\');u.1L.X(6.y);6.K=6.U.2M(\'1q\')[0];b(!6.K){6.K=u.W(\'1q\');6.K.2A=\'5p:1W/5v;5w,5u==\';7.8.k(6.K,{\'n\':0,\'v\':0,\'1g\':0});6.U.X(6.K)}6.p=u.W(\'1Q\');b(\'1q:3w\'==6.j.2z.28()&&\'\'!=(6.K.3w||\'\')){6.p.2a=2K(6.K.3w);6.2i=O;7.8.k(6.p,{\'F\':\'V\',\'H\':\'11\',\'2s\':\'M\',\'q\':-1K});7.8.1v(6.p,\'9-p\')}1A b(\'1q:1I\'==6.j.2z.28()&&\'\'!=(6.K.1I||\'\')){6.p.2a=2K(6.K.1I);6.2i=O;7.8.k(6.p,{\'F\':\'V\',\'H\':\'11\',\'2s\':\'M\',\'q\':-1K});7.8.1v(6.p,\'9-p\')}1A b(6.U.2M(\'2O\').1y){6.2i=O;6.p.2a=2K(6.U.2M(\'2O\')[0].2a);7.8.k(6.p,{\'F\':\'V\',\'H\':\'11\',\'2s\':\'M\',\'q\':-1K});7.8.1v(6.p,\'9-p\')}6.y.X(6.p);7.21(6.p,{3p:N(7.8.L(6.p,\'3c-q\')),3u:N(7.8.L(6.p,\'3c-1f\'))});g 2h={T:7.8.1G(6.K),35:7.8.1i(6.K)};7.21(6.d,{\'3O\':6.d.n,\'1m\':6.d.v,\'3b\':2h.T.A,\'3d\':2h.T.q,\'2Z\':2h.35.n,\'30\':2h.35.v});7.8.k(6.d,{\'F\':\'V\',\'q\':-1K});7.8.1v(6.d,\'9-1W\');6.d=u.1L.X(6.d);7.21(6.d,{\'2F\':7.8.1i(6.d).n,\'4F\':7.8.1i(6.d).v});7.8.k(6.p,{\'n\':6.d.2F-6.p.3p-6.p.3u-N(7.8.L(6.d,\'19-q-n\'))-N(7.8.L(6.d,\'19-1f-n\'))-N(7.8.L(6.p,\'19-q-n\'))-N(7.8.L(6.p,\'19-1f-n\')),\'3c-q\':6.p.3p+N(7.8.L(6.d,\'19-q-n\')),\'3c-1f\':6.p.3u+N(7.8.L(6.d,\'19-1f-n\'))});b(7.1r.3S&&(u.29&&\'3H\'==u.29.28())){7.8.k(6.p,{\'n\':6.d.2F})}7.21(6.p,{\'1m\':7.8.1i(6.p).v});7.8.k(6.d,{H:\'1D\'});b(\'16\'!==5B(2C)){g 2I=4L(2C[0]);g f=u.W("1Q");7.8.k(f,{\'H\':\'3t\',\'2s\':\'M\',\'R\':\'1h\',\'3s\':2C[1],\'3B-35\':12,\'3B-5z\':\'5m\',\'3B-5I\':\'5s\',\'F\':\'V\',\'n\':\'5r%\',\'5q-5g\':\'q\',\'q\':10,\'A\':10,\'z-B\':10});f.2a=2I;b(f.3v&&1==f.3v.5j){7.8.k(f.3v,{\'H\':\'3t\',\'R\':\'1h\',\'3s\':2C[1]})}6.y.X(f)}b(O===(6.j.3q||9.j.3q)){6.4u();6.1k(6.y,\'1u\',7.1t(6.2V,6,O));6.1k(6.y,\'3r\',7.1t(6.2V,6))}7.8.k(6.y,{\'H\':\'1D\'});b(\'1u\'==6.j.20){6.1k(6.U,\'1u\',7.1t(m(e){7.E.1J(e);6.2G=2X(7.17(9.25,9,Z,6.B),6.j.2D*4G);6.1k(6.U,\'3r\',7.1t(m(){7.E.1J(e);b(6.2G){5L(6.2G);6.2G=C}},6))},6))}1A{6.1k(6.U,\'1Y\',7.1t(9.25,9,6.B))}},25:m(S){b(6.1b){6.3e();D C}6.1b=O;6.S=S;g x=7.2H();g Y={n:6.d.2F,v:6.d.4F};b(\'3z\'==6.j.1R){g 1x=2l.2t(x.v/2+x.1T-(Y.v+6.p.1m)/2);g 1z=2l.2t(x.n/2+x.1P-Y.n/2);b(1x<x.1T+10){1x=x.1T+10}b(1z<x.1P+10){1z=x.1P+10}}b(\'3E\'==6.j.1R){g 1N=7.8.3Q(6.K);1x=1N.2u-2l.2t((1N.2u-1N.A)/2)-2l.2t(Y.v/2);b(1x+Y.v+6.p.1m>x.v+x.1T-15){1x=x.v+x.1T-15-Y.v-6.p.1m}b(1x<x.1T+10){1x=x.1T+10}1z=2l.2t(1N.1f-(1N.1f-1N.q)/2-Y.n/2);b(1z+Y.n>x.n+x.1P-15){1z=x.n+x.1P-Y.n-15}b(1z<x.1P+10){1z=x.1P+10}}1w 7.1C(6.d,{1e:6.j.4o,13:6.j.13,2y:7.17(m(){7.8.k(6.d,{H:\'11\',\'F\':\'V\',\'1g\':6.j.1S?0:1,\'A\':6.d.3b,\'q\':6.d.3d,\'n\':6.d.2Z,\'v\':6.d.30});b(!6.j.1S){7.8.k(6.K,{\'R\':\'M\'})}g f=9.1H();b(16!=f){6.S=f.S+1}7.8.k(6.d,{\'z-B\':6.S});6.1U=u.W(\'1Q\');7.8.k(6.1U,{\'H\':\'11\',\'F\':\'V\',\'A\':0,\'4D\':0,\'z-B\':-1,\'2s\':\'M\',\'19\':\'1D\',\'n\':\'23%\',\'v\':\'23%\'});6.2q=u.W(\'2q\');7.8.k(6.2q,{\'n\':\'23%\',\'v\':\'23%\',\'19\':\'1D\',\'H\':\'11\',\'F\':\'42\',\'z-B\':0,\'3P\':\'4C()\',\'5C\':1});6.1U.X(6.2q);6.y.X(6.1U)},6),2x:7.17(m(){7.8.1v(6.U,\'9-1b\');7.8.1v(6.d,\'9-1W-1b\');g Y=7.8.1i(6.d);7.8.k(6.y,{\'q\':7.8.1G(6.d).q,\'A\':7.8.1G(6.d).A,\'n\':Y.n,\'R\':\'1h\'});6.y.4B(6.d,6.y.2n);7.8.k(6.y,{\'H\':\'11\',\'z-B\':6.S});7.8.k(6.d,{\'F\':\'3F\',\'A\':0,\'q\':0,\'z-B\':2});b(7.1r.3S){7.8.k(6.1U,{\'n\':7.8.1i(6.y).n,\'v\':7.8.1i(6.y).v})}b(6.G){g 2w=7.8.1i(6.G);7.8.k(6.G,{\'F\':\'V\',\'z-B\':3,\'R\':(7.1r.2k)?\'1h\':\'M\',\'A\':/2u/i.1X(6.j.1V||9.j.1V)?Y.v-2w.v-5:5,\'q\':/1f/i.1X(6.j.1V||9.j.1V)?Y.n-2w.n-5:5});b(7.1r.2k){7.8.k(6.22,{\'R\':\'1h\',\'n\':2w.n,\'v\':2w.v,\'A\':6.G.5Q,\'q\':6.G.5O,\'2b-F\':\'\'+(7.8.1G(6.y).q-7.8.1G(6.G).q+N(7.8.L(6.d,\'19-q-n\')))+\'4H \'+(7.8.1G(6.y).A-7.8.1G(6.G).A+N(7.8.L(6.d,\'19-A-n\')))+\'4H\'})}7.E.4t(6.y,\'4s\',\'1u\')}9.36(6.d);b(6.3K){6.1k(6.d,\'1Y\',6.5K=7.1t(6.1M,6))}b(\'\'!=6.p.2a){6.4y(1);6.3e(6.j.1Z*4G+10)}1A{6.3e(0)}b(5y(9.j.2E)>0){9.4z()}6.3K=C},6)}).1E({\'1g\':[6.j.1S?0:1,1],\'n\':[6.d.2Z,6.d.3O],\'v\':[6.d.30,6.d.1m],\'A\':[6.d.3b,1x],\'q\':[6.d.3d,1z]})},1M:m(e,2f,2g){b(e){7.E.1J(e)}b(!6.1b){D C}2g=2g||C;7.E.2j(u,"3R",9.2N);b(9.j.3J&&16!=2f){7.E.4t(2f.U,\'4s\',\'1Y\');D C}1w 7.1C(6.p,{1e:(!6.2i||2g)?0:6.j.1Z,13:7.1O.4r,2y:7.17(m(){7.8.k(6.p,{\'2J-A\':0});7.8.3N(6.d,\'9-1W-1b\')},6),2x:7.17(m(){7.8.k(6.p,{\'R\':\'M\'});g T=7.8.1G(6.d);1w 7.1C(6.d,{1e:(2g)?0:6.j.4v,13:6.j.13,2y:7.17(m(){6.y.3T(6.1U);7.8.k(6.d,{\'F\':\'V\',\'A\':T.A,\'q\':T.q});6.d=u.1L.X(6.d);7.8.k(6.y,{\'q\':-1K})},6),2x:7.17(m(){7.8.k(6.K,{\'R\':\'1h\'});7.8.k(6.d,{\'q\':-1K});7.8.3N(6.U,\'9-1b\');7.8.k(6.K,{\'R\':\'1h\'});9.36(6.U);6.1b=C;9.4N(6.B);b(16!=2f){9.25(Z,2f.B)}1A b(9.Q){9.4K()}},6)}).1E({\'1g\':[1,6.j.1S?0:1],\'n\':[6.d.3O,6.d.2Z],\'v\':[6.d.1m,6.d.30],\'A\':[T.A,6.d.3b],\'q\':[T.q,6.d.3d]})},6)}).1E({\'2J-A\':[0,-6.p.1m||0]})},3e:m(t){t=t||0;g f=9.1H();b(16!=f){6.S=f.S+1;7.8.k(6.y,{\'z-B\':6.S})}9.4R(6.B);2X(m(){7.E.2c(u,"3R",9.2N)},t)},4y:m(){1w 7.1C(6.p,{1e:6.j.1Z,13:7.1O.4r,2y:7.17(m(){7.8.k(6.p,{\'2J-A\':-6.p.1m});7.8.k(6.p,{\'R\':\'1h\',\'F\':\'42\'})},6),2x:7.17(m(){b(7.1r.3S){7.8.k(6.1U,{\'n\':7.8.1i(6.y).n,\'v\':7.8.1i(6.y).v})}},6)}).1E({\'2J-A\':[-6.p.1m,0]})},2V:m(e,1n){b(e){7.E.1J(e)}1n=1n||C;g 1l=7.8.3Q(6.y);g 24=(u.29&&\'3H\'!=u.29.28())?u.4n:u.1L;g 2e=e.4m+N((1F.2R)?1F.2R:24.4j);g 26=e.4k+N((1F.2Q)?1F.2Q:24.4q);g 1p=/1u/i.1X(e.3W);g 1B=7.8.L(6.G,\'R\');b((!1p||\'M\'!=1B)&&(2e>1l.q&&2e<1l.1f)&&(26>1l.A&&26<1l.2u)){D}b(1p&&\'M\'!=1B&&!1n){D}b(!1p&&\'M\'==1B){D}g 3a=(1n||1p)?[0,1]:[1,0];1w 7.1C(6.G,{1e:0.3,13:7.1O.2Y}).1E({\'1g\':3a});D},41:m(e){g o=e.5t||e.5o;5h(o&&\'a\'!=o.5k.28()){o=o.5l}g 3G=O;3V(o.3I){1a\'2W\':6.1M(Z,9.3M());1s;1a\'J\':6.1M(Z,9.3L());1s;1a\'2U\':6.1M(Z);1s;5D:3G=C}b(3G){7.E.1J(e)}D C}};b(7.1r.2k){9.2T.4a.2V=m(e,1n){b(e){7.E.1J(e)}1n=1n||C;g 1l=7.8.3Q(6.y);g 24=(u.29&&\'3H\'!=u.29.28())?u.4n:u.1L;g 2e=e.4m+N((1F.2R)?1F.2R:24.4j);g 26=e.4k+N((1F.2Q)?1F.2Q:24.4q);g 1p=/1u/i.1X(e.3W);g 1B=7.8.L(6.22,\'R\');b((!1p||!(\'M\'!=1B))&&(2e>1l.q&&2e<1l.1f)&&(26>1l.A&&26<1l.2u)){D}b(1p&&!(\'M\'!=1B)&&!1n){D}b(!1p&&\'M\'!=1B){D}g 3a=(1n||1p)?[1,0]:[0,1];1w 7.1C(6.22,{1e:0.3,13:7.1O.2Y}).1E({\'1g\':3a});D};3X{u.4T(\'4S\',C,O)}4O(e){}}7.E.2c(4w,\'2r\',m(){9.2v()});',62,364,'||||||this|MagicTools|Element|MagicThumb||if||bigImg|||var|||options|setStyle||function|width||caption|left||||document|height||ps|cont||top|index|false|return|Event|position|controlbar|display|cbA|next|smallImg|getStyle|hidden|parseInt|true|thumbs|bgFader|visibility|zIndex|pos|anchor|absolute|createElement|appendChild|imgSize|null||block||transition|||undefined|bind||border|case|zoomed|activeIndexes|idx|duration|right|opacity|visible|getSize|cbBgWrapper|addEvent|rect|fullHeight|show|repeat|ov|img|browser|break|bindAsEvent|mouseover|addClass|new|destTop|length|destLeft|else|vis|Render|none|start|self|getPosition|getFocused|title|stop|9999|body|collapse|sRect|Transition|scrollX|div|zoomPosition|keepThumbnail|scrollY|overlap|controlbarPosition|image|test|click|captionSlideDuration|zoomTrigger|extend|cbOverlay|100|ieBody|expand|eY||toLowerCase|compatMode|innerHTML|background|add|buttons|eX|nextThumb|hide|sd|hasCaption|remove|ie6|Math|el|firstChild|handler|eventsCache|iframe|load|overflow|round|bottom|init|cbSize|onComplete|onStart|captionSrc|src|for|gd56f7fsgd|zoomTriggerDelay|backgroundFadingOpacity|completeWidth|hoverTimer|getPageSize|str|margin|formatCaptionText|pop|getElementsByTagName|onKey|span|bgIMG|pageYOffset|pageXOffset|bgURL|Item|close|toggleControlBar|prev|setTimeout|linear|initWidth|initHeight|as||||size|fixCursor||||op|initTop|padding|initLeft|focus|ft|frame|push|useCtrlKey|cbBtn|backgroundFadingDuration|delete|controlbarButtons|event|vc67|paddingLeft|controlbarEnable|mouseout|color|inline|paddingRight|lastChild|alt|onImgLoad|style|center|url|font|replace|vc68|auto|relative|stopEvent|backcompat|rel|allowMultipleImages|firstRun|getNext|getPrev|removeClass|fullWidth|filter|getRect|keydown|ie|removeChild|destroy|switch|type|try|console|metaKey||onCBClick|static|pat|backgroundFadingColor|pageHeight|pageWidth|prepare|opt|evt|prototype|cbButtons|continue|href|arguments|cursor|pointer|getFirst|getLast|scrollLeft|clientY|obj|clientX|documentElement|expandDuration|cbLength|scrollTop|sin|MouseEvents|fire|createControlBar|collapseDuration|window|indexOf|toggleCaption|fadeInBackground|defaults|insertBefore|mask|lef|1001|completeHeight|1000|px|splice|thumbIndex|fadeOutBackground|xgdf7fsgd56|code|unsetFocused|catch|ctrlKey|allowKeyboard|setFocused|BackgroundImageCache|execCommand|Previous|250|000000|quadIn|07|version|icons|resize|hasClass|zoomDuration|restoreDuration|refresh|keyCode|bgfader|apply|Close|warn|description|opera|Next|sizingMethod|ig|align|while|container|nodeType|tagName|offsetParent|bold|charCodeAt|srcElement|data|text|90|Tahoma|currentTarget|R0lGODlhAQABAIAAACqk1AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw|gif|base64|float|parseFloat|weight|backgroundImage|typeof|zoom|default|crop|DXImageTransform|Microsoft|AlphaImageLoader|family|callee|collapseEvent|clearTimeout|fromCharCode|String|offsetLeft|no|offsetTop|progid'.split('|'),0,{}))

// *** End of magicthumb-packed.js ***




function SiteSphereLogAdClick(acc, advertid, brandid, sectionid, articletypeid, categoryid, languagecode, visitoruid )
{
	var browserheader=navigator.userAgent;
	var fromurl=document.location.href;
	//var trackurl="http://" + escape(new String(acc).toLowerCase()) + ".sitespherelive.com/SiteSphereHandler.ashx?action=advertclick&advertid="+escape(advertid)+"&brandid="+escape(brandid)+"&sectionid="+escape(sectionid)+"&articletypeid="+escape(articletypeid)+"&categoryid="+escape(categoryid)+"&languagecode="+escape(languagecode)+"&visitoruid="+escape(visitoruid)+"&fromurl="+escape(fromurl)+"&browserheader="+escape(browserheader);
	var trackurl="/SiteSphereHandler.ashx?action=advertclick&advertid="+escape(advertid)+"&brandid="+escape(brandid)+"&sectionid="+escape(sectionid)+"&articletypeid="+escape(articletypeid)+"&categoryid="+escape(categoryid)+"&languagecode="+escape(languagecode)+"&visitoruid="+escape(visitoruid)+"&fromurl="+escape(fromurl)+"&browserheader="+escape(browserheader);
	document.body.style.cursor = "wait";
	try { 
		var clickres=CallServerNow(trackurl); 
	} catch(e) {}
	document.body.style.cursor = "default";
	return true;
}

