/*Important Function to blend the tabs in and out*/
function blendoff(idname) {
    document.getElementById(idname).style.display = 'none';
}
function blendon(idname) {
    document.getElementById(idname).style.display = 'block';
}
/*Function for our Tabmenu with 4 Tabs*/
function swichtabs(wert) {
    if (wert=='1'){
        document.getElementById('tablink1').className='tab1 tabactive';
        //document.getElementById('tablink2').className='tab2';
        document.getElementById('tablink3').className='tab3';
       // document.getElementById('tablink4').className='tab4';
    }else if (wert=='2'){
        document.getElementById('tablink1').className='tab1';
        document.getElementById('tablink2').className='tab2 tabactive';
        document.getElementById('tablink3').className='tab3';
        document.getElementById('tablink4').className='tab4';
    }else if (wert=='3'){
        document.getElementById('tablink1').className='tab1';
       // document.getElementById('tablink2').className='tab2';
        document.getElementById('tablink3').className='tab3 tabactive';
        //document.getElementById('tablink4').className='tab4';
    }	else if (wert=='4'){
        document.getElementById('tablink1').className='tab1';
        document.getElementById('tablink2').className='tab2';
        document.getElementById('tablink3').className='tab3';
        document.getElementById('tablink4').className='tab4 tabactive';
    }
}

function nivoPopup(){
    $(document).ready(function() {

        //select all the a tag with name equal to modal
        $('a[name=modal]').click(function(e) {
            //Cancel the link behavior
            e.preventDefault();

            //Get the A tag
            var id = $(this).attr('href');

            //Get the screen height and width
            var maskHeight = $(document).height();
            var maskWidth = $(window).width();

            //Set heigth and width to mask to fill up the whole screen
            $('#mask').css({
                'width':maskWidth,
                'height':maskHeight
            });

            //transition effect
            $('#mask').fadeIn(1000);
            $('#mask').fadeTo("slow",0.8);

            //Get the window height and width
            var winH = $(window).height();
            var winW = $(window).width();

            //Set the popup window to center
            $(id).css('top',  winH/2-$(id).height()/2);
            $(id).css('left', winW/2-$(id).width()/2);

            //transition effect
            $(id).fadeIn(2000);

        });

        //if close button is clicked
        $('.window .close').click(function (e) {
            //Cancel the link behavior
            e.preventDefault();

            $('#mask').hide();
            $('.window').hide();
        });

        //if mask is clicked
        $('#mask').click(function () {
            $(this).hide();
            $('.window').hide();
        });

    });

}
function theRotator() {
    //Set the opacity of all images to 0
    $('div.rotator ul li').css({
        opacity: 0.0
    });
    //Get the first image and display it (gets set to full opacity)
    $('div.rotator ul li:first').css({
        opacity: 1.0
    });
    //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
    setInterval('rotate()',6000);
}
function rotate() {
    //Get the first image
    var current = ($('div.rotator ul li.show')?  $('div.rotator ul li.show') : $('div.rotator ul li:first'));
    if ( current.length == 0 ) current = $('div.rotator ul li:first');
    //Get next image, when it reaches the end, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.rotator ul li:first') :current.next()) : $('div.rotator ul li:first'));
    //Un-comment the 3 lines below to get the images in random order

    //var sibs = current.siblings();
    //var rndNum = Math.floor(Math.random() * sibs.length );
    //var next = $( sibs[ rndNum ] );

    //Set the fade in effect for the next image, the show class has higher z-index
    next.css({
        opacity: 0.0
    })
    .addClass('show')
    .animate({
        opacity: 1.0
    }, 1000);

    //Hide the current image
    current.animate({
        opacity: 0.0
    }, 2000)
    .removeClass('show');

}



function getvideo(){
    document.getElementById('video').style.display='inline';
    document.getElementById('video_image').style.display='none';
}
function validation(){
if(document.getElementById('name').value ==""){
    alert("Please Enter your name.");
    document.getElementById('name').focus();
    return false;
 }
if(document.getElementById('name').value ==""){
    alert("Please Enter your name.");
    document.getElementById('name').focus();
     return false;
}
if(document.getElementById('phoneno').value != ""){
   if(isNaN(document.getElementById('phoneno').value)==true){
      alert("Please Enter valid phone number.");
       return false;
   }
}
if(document.getElementById('emailid').value ==""){
    alert("Please Enter your Email.");
    document.getElementById('emailid').focus();
    return false;
}
if(ValidateEmail(document.getElementById('emailid').value)==false){
    alert("Please Enter your correct email.");
    document.getElementById('emailid').focus();
    return false;
}
if(document.getElementById('comments').value ==""){
    alert("Please Enter your comments.");
    document.getElementById('comments').focus();
    return false;
}
    var Upload_Image = document.getElementById('upFile');
    var myfile = Upload_Image.value;
    if(myfile !=""){
      if(myfile.indexOf("doc") >0 || myfile.indexOf("docx")>0 || myfile.indexOf("txt")>0 || myfile.indexOf("xls")>0 || myfile.indexOf("xlsx")>0 || myfile.indexOf("ppt")>0 || myfile.indexOf("pptx")>0 || myfile.indexOf("pdf")>0)
      {//return false;
      } else {
        alert('Allowed file types :  doc, docx, txt, xls, xlsx, ppt, pptx and pdf');
        return false;
      }
     }
}


/*Validate email address */
function ValidateEmail(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
    }
    return true
}
function moveRight(){
document.all.myMarquee.direction = "right";
   
}
function moveLeft(){
document.all.myMarquee.direction = "left";

}

function layout(){
document.getElementById("header").innerHTML = '<div class="header"><span style="float:left"><a href="index.html"><img src="images/spacer.gif" border="0" style="width:190px;height:42px;" /></a></span><span class="contact"><table border="0"><tr><td class="contact" valign="top">UNITED STATES<BR>Plesanton,CA<br>1-926-216-0669</td><td class="contact" valign="top">INDIA<br>Chennai<br>044-42039192/93 </td><td valign="center"><a href=""><img border="0" src="images/twitter-botton.jpg" /></a>&nbsp;<a target="_blank" href="http://www.facebook.com/people/Riverstone-InfoTech/100002824615534"><img border="0" src="images/facebook.jpg" /></a></td></tr></table></span></div>';
document.getElementById("smoothmenu1").innerHTML = '<ul><li><a href="index.html">Home</a></li><li><a href="#">Team</a><ul><li><a href="manage.html">Management</a></li><li><a href="partners.html">Partners</a></li></ul></li><li><a href="services.html">Services</a><ul><li><a href="customdevelop.html">Custom Development</a></li><li><a href="productdevelop.html">Product Development</a></li><li><a href="technology.html">Technology Consulting</a></li><li><a href="projectmanage.html">Project Management</a></li><li><a href="prototype.html">Software Prototyping</a></li><li><a href="mobileapps.html">Mobile Application</a></li><li><a href="opensource.html">Open Source</a></li><li><a href="hostingservice.html">Hosting Service</a></li></ul></li><li><a href="strategies.html">Strategies</a></li><li><a href="solutions.html">Solutions</a></li><li><a href="clients.html">Clients</a></li><li><a href="careers.html">Careers</a></li><li><a href="contact.html">Contact</a></li></ul><br style="clear: left" />';
document.getElementById("footer").innerHTML = '<div class="footermenubg"><table border="0" style="width:900px;margin: 15px 10px 15px 15px;"><tr><td height="100" valign="top" width="10%"><table border="0" cellpadding="0" cellspacing="0" width="93%"><tbody><tr><td id="footerRight"><strong>Company</strong></td></tr><tr><td id="footerRight"><a href="aboutus.html">About Us</a></td></tr><tr><td id="footerRight"><a href="manage.html">Our Team</a></td></tr><tr><td id="footerRight"><a href="contact.html">Locations</a></td></tr><tr><td id="footerRight">&nbsp;</td></tr></tbody></table></td><td valign="top" width="25%"><table border="0" cellpadding="0" cellspacing="0" width="93%"><tr><td colspan="2" id="footerRight"><strong>Services</strong></td></tr><tr><tr><td id="footerRight"><a href="customdevelop.html">Custom Development</a></td>  <td id="footerRight" style="padding-left:10px;"><a href="prototype.html">Software Prototyping</a></td></tr><tr><td id="footerRight"><a href="productdevelop.html">Product Development</a></td>  <td id="footerRight" style="padding-left:10px;"><a href="mobileapps.html">Mobile Application</a></td></tr><tr><td id="footerRight"><a href="technology.html">Technology Consulting</a></td>   <td id="footerRight" style="padding-left:10px;"><a href="opensource.html">Open Source</a></td></tr><tr><td id="footerRight"><a href="projectmanage.html">Project Management</a></td>  <td id="footerRight" style="padding-left:10px;"><a href="hostingservice.html">Hosting Service</a></td></tr></table></td><td valign="top" width="16%"><table border="0" cellpadding="0" cellspacing="0" width="88%"><tbody><tr><td id="footerRight"><strong>Clients</strong></td></tr><tr><td id="footerRight"><a href="clients.html">Client List</a></td></tr><tr><td id="footerRight"><a href="#">Clients Testimonials</a></td></tr><tr><td id="footerRight">&nbsp;</td></tr><tr><td id="footerRight">&nbsp;</td></tr></tbody></table></td><td valign="top" width="10%"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td id="footerRight"><strong>Links</strong></td></tr><tr><td id="footerRight"><a href="http://www.caddesignonline.com/" target="_blank">Caddesignonline.com</a></td></tr><tr><td id="footerRight"><a href="http://www.riverstone.in/" target="_blank">Riverstone.in</a></td></tr><tr><td id="footerRight">&nbsp;</td></tr><tr><td id="footerRight">&nbsp;</td></tr></tbody></table></td></tr></table></div>';
                        
}
function menu(){
        ddsmoothmenu.init({
            mainmenuid: "smoothmenu1", //menu DIV id
            orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
            classname: 'ddsmoothmenu', //class added to menu's outer DIV
            //customtheme: ["#1c5a80", "#18374a"],
            contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
        })
        ddsmoothmenu.init({
            mainmenuid: "smoothmenu2", //Menu DIV id
            orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
            classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
            //customtheme: ["#804000", "#482400"],
            contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
        })
        }
    

